Thank you !
But what I want is to read the modified values , but I want that the query include the where clause , so in other words I just want to have on query results only nm2.
So how can I force to load from cache with the where clause.
' Query the database:
query1 = (From t In context.table1 Where t.quantity > 0Select t).ToList()
query1.First().Quantity -= 3' Query the local cache:
query1 = (From t In context.table1.Local Where t.quantity > 0Select t).ToList()
However, this will not load any new entities which have been added to the database since your first query.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
I have a datatable that contains some detailed data in a report, and I need to summarize the data. Depending on the report, the column names changes and I have a settings table that contains the column name, and if the column must be grouped by, summed, or counted. There can be various columns that needs to be grouped and summed. how would I go about doing this, baring in mind that this needs to be dynamically...
For example Report 1 has a account, year, month, qty, amount column. Based on the settings, I need to group by account, year, month and sum the qty and amount.
I need to use the datatable that already has the data s the user can filter it - then I need to display a summary based on the data and user input. I do not want to retrieve the data from the server again.
I want to add header to my csv file how please help me
Dim parsedData = New List(Of String())()
Using sr = New StreamReader("H:/test.csv")
Dim line As String
line = sr.ReadLine()
Do While line IsNot Nothing
Dim row() As String = line.Split(","c)
line = sr.ReadLine()
DataGridView1.ColumnCount = 6
For i As Integer = 0 To 5
Dim sb = New StringBuilder(parsedData(0)(i))
sb.Replace("_"c, " "c)
sb.Replace("""", " ")
DataGridView1.Columns(i).Name = sb.ToString()
For Each row As String() In parsedData
Why are you using the parsedData object? That just adds complexity to your code. The actual method only needs the following logic:
1. Read the first line of the csv file (assuming it contains the header labels), and use the fields from that to set your DataGridView headers.
2. Read the remaining lines one by one, and use them to fill the data rows of the dgv.
I Have no idea what happened here. I finally just deleted the whole project and started
over. I recreated the old code a little at a time and now everything works. I am sorry for
this post. If anyone has ever encountered this problem I would be interested in what happened
so I don't do it again.
I do not know why I have never encountered this before but here goes.
I have created a new windows forms project called MyProject.
I create a new UserControl within the project called Test.vb the normal way:
1. Right click MyProject
2. Click Add + UserControl
I do not modify the control in any way.
Compile and build is ok.
I drag the new 'Test' control from the toolbox to the main form and save.
The designer saves the Test control with these entries:
Friend WithEvents Test1 as MyProject.Test
Private Sub InitializeComponent()
Me.Test1 = new MyProject.Test
... plus other normal initialization
For some reason the compiler does not recognize the 'MyProject.Test' control as
part of the project. It indicates that 'Test' is 'not defined'. If I change the declaration in
the MyProject.Designer.vb 'Test' without 'MyProject.' reference, the compiler builds with
However the next time I edit the form, the designer saves the control
the same way; ie. MyProject.Test.
Why does the compiler not recognize Test as part of MyProject.Test?
I am trying to make a simple score card by entering the score for each player for each round in a lbl_round.text and then having each round show in a Lbl_total.text
Problem is, if player 1 in round 1 scores 7 all is fine round1.text shows 7 and total.text shows 7 but when I come again to player 1, round score may be 6 which should show in total score as 13 but instead I get 76. Below is the code:
If you "add" strings then you really expand them - that means :
the Result of adding "7" and "6" is "76". That is what your code does.
What you want to have is adding the numeric values - so you should cast each string perhaps to an Integer and add them now. Finally you convert the Integer-Value back into your Result ...
This is the kind of problem you get when using controls to store your game state.
DON'T DO THAT! Controls are there to SHOW and EDIT your data, not to hold it for you.
Maintain your values (state) in a class, or other appropriate storage, such as a structure, designed for the purpose. The controls can then get their values from the game state storage. Doing this also frees you from parsing or casting data back and forth.
"Good" is in the eyes of the beholder; I prefer to see error-handling when getting user-input. If you don't mind, who am I to say it is wrong? Are you sure that "static" is what you want, or do you just need some int? And again, you're using the UI to keep a current "state"; meaning, you're abusing the controls for something that should be a separate variable.
..and no documentation. No single comment. I'd be more impressed if the amount of totals were variable, but impossible to say if that's logical from a user-viewpoint. Depends on what the code is required to do.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
Are you sure that "static" is what you want, or do you just need some int?
Not sure what I want only started using it 2 days ago.
The program is only for me when playing a game with family that scores each round and has a running total. It's so small it doesn't need comments so is it good? It does what I want without errors it's for personal use so I guess it's good.
Thanks to all who have contributed.
Right now I am first year student in University with a bit of time on my hands, so I wanted to combine 2 of my passions - poker & programming.
I want to build an app, that would count my fold count in a row (in PokerStars environment).
How I have imagined it, would be a small box next to my username that overlays opened poker table, showing how many times have I folded in a row real time. Similar to HU display.
Easiest way to count folds, would be garbing info from hand histories. Where I am stuck is, how do I display the info.
It could work as I input my players name, and then the program automatically finds the right position (the seat where the player sits) and then 20px to the right, and 20 pix to the left displays small overlaying box with a value of Fold count.
I need to figure out, how can I input stringvalue, such as the player name, and the program checks the opened player table window, and gives me x and y pixel coordinates of wherethis players name is displayed on the game table window.
My question is, how do these 3rd party app companies can take the info from the opened poker table application window? What method do they use? If someone could steer me in the right direction, that would be awesome! For all the answers, thanks in advance!
I have been working with vb.net but I'm new to vbscript. Please can someone help me out.
I'm try to code vbscript to can help me to silently install mysql, install mysql service and setup root password. below are my code:
Wscript.Echo "Starting Install..."
set mysql_datadir="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 6.0\data"
set mysql_data2="C:\Program Files\MySQL\MySQL Server 6.0\data"
set mysql_cmd="GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mysql' WITH GRANT OPTION;"
set mysql_inst="msiexec /i %mysql_msi% /qn"
Wscript.Echo "MySQL Version 6.0.7 installed..."
rem md %mysql_data2%