try this.... in ur code page in the top of the page wrie Imports System.Data.oledb like this... Imports System.Data.oledb Public Class Form1 Inherits System.Windows.Forms.Form
and in ur button Protected Sub btnCommit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCommit.Click Dim MySql As as new oledbcommand mysql.Connection = OleDbConnection1 oledbconnection1.Open() ' open connection my sql.commandtext = "Insert into ExpenseReport _ (DateRow1,WhomRow1,CCardAmountRow1,PCardAmountRow1,CashAmount,VehicleNumRow1,ProjectnameRow1, _ TypeofExpenseRow1) values( " tbxDate.Text.ToString & "," & tbxWhom.Text.ToString & "," & _ tbxCCard.Text.ToString & "," & tbxPCard.Text & "," & tbxCash.Text & "," & tbxVehicle.Text & "," & _ tbxProject.Text.ToString & "," & ddnExpense.SelectedValue.ToString) mysql.ExecuteNonQuery() oledbconnection1.close() End Sub End Class
that if u create ur connectin by the wizard and as i know the wizard allready will give u name of ur connection as (oledbconnection1) i hope that will work:) rusashksa@yahoo.com Sally<<<>>>tAkE mE 2 uR pAraDiSe<<<>>>Sally
Paradise Bride
Posts
-
gettinig insert error and need help -
dealing with more than tablehello friends....how r u? well i've 3 tables in access and i wanna connect with them by vb.net .....any help plzzzzzzzzzzz see my codes... in buttun btnsearch , i used select command to search about information about patiend by his name then display that in textboxes as......
Private Sub Btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnsearch.Click Dim Sel As New OleDbCommand Dim R As OleDbDataReader Sel.Connection = OleDbConnection1 Sel.CommandText = "select* from [patients appointment] where ([patient_name]=" & TxtName.Text & ")" OleDbConnection1.Open() R = Sel.ExecuteReader If R.Read Then TxtName.Text = R.GetValue(0) TxtFleNum.Text = R.GetValue(1) TxtDate.Text = R.GetValue(2) TxtDoName.Text = R.GetValue(3) TxtClinic.Text = R.GetValue(4) TxtNote.Text = R.GetValue(5) Else MsgBox("we can't find any date about the selected name") End If OleDbConnection1.Close() R.Close() End Sub
well... i used up to search about patient and display his information from 1 table, but that patient have another information in another table and i wanna display that in textbox...how can i do that in button of search?? i hope u understood me and i can find answers:) Sally>>>><<<>>><<<