Updating Records

frankwhite

Well-known member
Joined
Nov 30, 2004
Messages
49
Programming Experience
Beginner
Hi, the following coding works on a form where I want information entered in a textbox to update in a Datagrid.

[FONT=&quot][/FONT]
VB.NET:
 Dim Neworder As DataRow = DsItems1.Tables("Items").NewRow()
    Neworder("Description") = TextBox1.Text
    Neworder("Quantity") = TextBox2.Text
    DsItems1.Tables("Items").Rows.Add(Neworder)

It works great apart from the fact I want my datagrid to be on another form. I have a "Load" button on the another form which I know how to work and it also contains the datagrid, I want the information entered here to be filling up the datagrid on that page. Is this possible? Thanks
 
Public Sub New(ByVal DsItemsGivenOut1 As DataSet)
End Sub

ok, so this is a constructor, and it is properly configred to take the dataset as a parameter, but then it does nothing with it!


by way of another example, suppose you wrote a sub that would show a message on screen, and then asked why this code didnt show anything on screen:
VB.NET:
Public Sub ShowMessage(message as String)
End Sub


VB.NET:
  Dim s as string = "Hello world"
  ShowMessage(s)

I think you could tell me why this code doesnt show the message, so you can work out why your code also does nothing with the dataset..
 
What happened to this? Actually doing something with the input parameter given?
I have used your coding on my form 2

Public Sub New(ByVal parameter As DataSet)
DataGrid1.DataSource = parameter
End Sub
 
Back
Top