Hello I am a newbie trying my hand at my first database program.

I am attempting to use the SQL expressl to store info?

Right now I have both a dataset with a tableadapter which has a query to 
insert.  Plus I wrote the following code.

Connection string...blha blah.
cmd.commandtext= "Insert Into  Mytable" & _
                              "(obid, FName, LastName, Finitial, Linital)
                             "Values(@p1, .........

that was a bad example I know...LOL... the problem I run in is three fold.

One the Finital and Linital are variables delcared as strings.  I am getting a 
bind error that it can't bind to the colum. since they aren't textboxes how do 
you get variable to be stored inoto the database?  
                   I have 
                    cmd.Paramerters.AddwithValule("@F_Initial", finitial)   
This is where the exception is thrown.
                     Secondly if I am going to hand code this so that it fires 
off with a button push do I need to do the tableadapter and dataset.  That 
seems so confusing.  Also how would it be coded so that the PrimeKey is 
automatic...do you have to set up like a base and then add to it for each 
insert or does this automaticly?  
  Thanks in advance!




      

Reply via email to