#### error inserting a row into a datatable

G

Guest

Hi Cor

I deleted the line.
da.FillSchema(dsFullBooking, SchemaType.Mapped, "dtClient"

i have declared NoOfRows with the 'as interger' and option Strinct on
I know get the correct number of rows appearing for my initial count

I am still getting the error message on the line..
ClientInsRow = dsFullBooking.Tables("dtClient").Rows(MyRowNumberAfterIns)("Forename")
= txtForename.Tex

An unhandled exception of type 'System.InvalidCastException' occurred in Caravan.ex
Additional information: Specified cast is not valid

is the syntax for this line correct? Can i add values in this way to a specific row and coloumn
I cant see what the problem could be. I have checked numerous examples!!
:blush:
Am i missing something here!!
 
G

Guest

Hi Cor,

I deleted the line..
da.FillSchema(dsFullBooking, SchemaType.Mapped, "dtClient")

i have declared NoOfRows with the 'as interger' and option Strinct on.
I know get the correct number of rows appearing for my initial count.

I am still getting the error message on the line...
ClientInsRow = dsFullBooking.Tables("dtClient").Rows(MyRowNumberAfterIns)("Forename")
= txtForename.Text

An unhandled exception of type 'System.InvalidCastException' occurred in Caravan.exe
Additional information: Specified cast is not valid.

is the syntax for this line correct? Can i add values in this way to a specific row and coloumn?
I cant see what the problem could be. I have checked numerous examples!!!
:blush:(
Am i missing something here!!
 
C

Cor

Hi Eva,

I had added this in my last message
ClientInsRow = dsFullBooking.Tables("dtClient").Rows(MyRowNumberAfterIns)("Forename")
= txtForename.Text

ClientInsRow = dsFullBooking.Tables("dtClient").Rows(MyRowNumberAfterIns)
Clientrow ("Forename") = txtForename.Text
Clientrow ("Surname") = txtSurname.Text

Cor
 
G

Guest

Hi Cor

U have just solved all my problems. Thx for being so patient with me.
U have been a fantastic help
:blush:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top