Hi
I am using vb.net 2008 trying to add record to my mdf file.
Mdf file was created using sql server 2008.
Code:
' Dim builder As DataRowBuilder
Dim dsnewrow As New DataRow
dsnewrow = dscontact.Tables("Contact").NewRow
If mblnadd Then
Try
dsnewrow("ContactID") = cbocontact.Text
dsnewrow("Name") = txtcontactname.Text
dsnewrow("Mobile") = txtmobile.Text
dsnewrow("Fax") = txtfax.Text
dsnewrow("Email") = txtemail.Text
dscontact.Tables("Contact").Rows.Add(dsnewrow)
Catch ex As Exception
MessageBox.Show("Unable to add record", "Contact")
End Try
mblnadd = False
MessageBox.Show("Record Added Sucessfully", "Contact")
End If
Error Message:
'System.Data.Datarow.Protected Friend Sub New(builder as
System.data.datarowbuilder
is not accessible in this context
becuase it is 'Protected Friend'.
May I know how do I solve this issue.
Thanks a million.
I am using vb.net 2008 trying to add record to my mdf file.
Mdf file was created using sql server 2008.
Code:
' Dim builder As DataRowBuilder
Dim dsnewrow As New DataRow
dsnewrow = dscontact.Tables("Contact").NewRow
If mblnadd Then
Try
dsnewrow("ContactID") = cbocontact.Text
dsnewrow("Name") = txtcontactname.Text
dsnewrow("Mobile") = txtmobile.Text
dsnewrow("Fax") = txtfax.Text
dsnewrow("Email") = txtemail.Text
dscontact.Tables("Contact").Rows.Add(dsnewrow)
Catch ex As Exception
MessageBox.Show("Unable to add record", "Contact")
End Try
mblnadd = False
MessageBox.Show("Record Added Sucessfully", "Contact")
End If
Error Message:
'System.Data.Datarow.Protected Friend Sub New(builder as
System.data.datarowbuilder
becuase it is 'Protected Friend'.
May I know how do I solve this issue.
Thanks a million.