Another question:
I created the connection to a database as like:
Sub App_Start
Form1.Show
'Setting connection to the database
con.New1
cmd.New1("",con.Value)
con.Open("data source =" & AppPath & "\kamlapur.sl3")
..........
end sub
I want use a button to save the data from few combo boxes and text boxes to the above database. How shold I write the INSERT command in the click event of the button? I tried some thing like:
Sub msave_Click
If cmbstar.SelectedIndex = -1 Then
Msgbox ("No staturm Selected","Error")
cmbstar.Focus
Else If cmbclu.SelectedIndex= -1 Then
Msgbox ("No Cluster Selected","Error")
cmbclu.Focus
Else If txthhid.Text="" Then
Msgbox ("No Structure Selected","Error")
txthhid.Focus
Else If txtiid.Text="" Then
Msgbox ("No HH No. Selected","Error")
txtiid.Focus
Else If txthhidtn.Text="" Then
Msgbox ("No HH ID Selected","Error")
txthhidtn.Focus
Else
cmd.CommandText=insert into kamlapur.sl3 values(cmbstar.SelectedIndex,cmbclu.SelectedIndex,txthhid.Text,txtiid.Text,txthhidtn.Text)
cmd.ExecuteTable(kamlapur.sl3,500)
'table1.AddRow (cmbstar.SelectedIndex,cmbclu.SelectedIndex,txthhid.Text,txtiid.Text,txthhidtn.Text)
'table1.SaveCSV(dataFile,",",true)
End If
End Sub
But it gives error message.
could you suggest the correct syntax?
your help is highly appreciated.
regards,