datarow question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to create an instance of a data row, set it's cells, and pass
this to a function for update. Well, so far this is not working a i'm sure
most of you will know why. What's the correct way to do this.
the dataset exists. I guess i need to know how to create the row?
Dim dr As dsUser.usrRow
dr.usrFName = Me.txtFName.Text
dr.usrLName = Me.txtLname.Text
 
yes, of course. (and thanks for replying).
1. dataset dsUser definition is defined via a sqldataadapter in vs.net (it
is not added to the designer) and i'm creating an instance here:
Dim thsusr As UserServices = New UserServices
If IsValid Then
Dim ds As dsUser = New dsUser
Dim dr As DataRow
dr = ds.usr.NewRow
i can get it to work in both of the following ways,
dr(ds.usr.usrCompanyColumn.ColumnName) = Me.txtCompany.Text
dr("usrCompany") = Me.txtCompany.Text

but not this way, but not this way
dr.usrCompany = me.txtcompany.text
thanks
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes


Miha Markic said:
Can you show us more code?
 
try this:

Dim ds As dsUser = New dsUser
Dim dsUser.UserRow userRow = dsUser.NewUserRow
userRow.usrCompany = ....

Basically your getting a strongly typed row from your strongly typed
dataset.

- Ron

WebBuilder451 said:
yes, of course. (and thanks for replying).
1. dataset dsUser definition is defined via a sqldataadapter in vs.net (it
is not added to the designer) and i'm creating an instance here:
Dim thsusr As UserServices = New UserServices
If IsValid Then
Dim ds As dsUser = New dsUser
Dim dr As DataRow
dr = ds.usr.NewRow
i can get it to work in both of the following ways,
dr(ds.usr.usrCompanyColumn.ColumnName) = Me.txtCompany.Text
dr("usrCompany") = Me.txtCompany.Text

but not this way, but not this way
dr.usrCompany = me.txtcompany.text
thanks
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes


Miha Markic said:
Can you show us more code?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

message
I'm trying to create an instance of a data row, set it's cells, and
pass
this to a function for update. Well, so far this is not working a i'm
sure
most of you will know why. What's the correct way to do this.
the dataset exists. I guess i need to know how to create the row?
Dim dr As dsUser.usrRow
dr.usrFName = Me.txtFName.Text
dr.usrLName = Me.txtLname.Text
 
Back
Top