Click here to Skip to main content
15,907,905 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionMultithreading Appplication Pin
mhovidz18-Apr-07 6:14
mhovidz18-Apr-07 6:14 
AnswerRe: Multithreading Appplication Pin
Dave Kreskowiak18-Apr-07 6:28
mveDave Kreskowiak18-Apr-07 6:28 
QuestionMessage Handling Pin
oerbay18-Apr-07 5:35
oerbay18-Apr-07 5:35 
AnswerRe: Message Handling Pin
MohammadAmiry18-Apr-07 5:50
MohammadAmiry18-Apr-07 5:50 
QuestionChanging exchange server in outlook profile Pin
PZC_JPC18-Apr-07 4:49
PZC_JPC18-Apr-07 4:49 
QuestionCitrix - CommonLanguage Runtime Debugging Services [modified] Pin
Chuck Easter18-Apr-07 4:37
Chuck Easter18-Apr-07 4:37 
AnswerRe: Citrix - CommonLanguage Runtime Debugging Services Pin
Dave Kreskowiak18-Apr-07 6:29
mveDave Kreskowiak18-Apr-07 6:29 
Questioncant add to database Pin
peteyshrew18-Apr-07 0:49
peteyshrew18-Apr-07 0:49 
having problems with adding to the database.
the code i have should work, but nothing is getting added to my database. below is the code i have. can anyone pinpoint my broblem and rectify it for me?, thanks


Imports System.Data.OleDb
Public Class cust
Public conn As OleDbConnection
Public comm As OleDbCommand
Public dr As OleDbDataReader
Public da As OleDbDataAdapter
Dim icount As Integer
Dim str As String



Private Sub cust_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn = New OleDbConnection 'establishes that conn is a new connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\PCbank.mdb" 'the name of the connection (name of the database on the end)
conn.Open() 'opens the connection

comm = New OleDbCommand 'establishes that comm is a new command
comm.Connection = conn 'the connection for the command is the connection specified
comm.CommandType = CommandType.Text 'the commands are in text

End Sub

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
conn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=PCbank")
conn.Open()
comm = New OleDbCommand("insert into customers(CustomerID,CustomerSurname,CustomerForename) values('" & (tbID.Text) & "','" & (tbSur.Text) & "','" & (tbFor.Text) & ")", conn)
icount = comm.ExecuteNonQuery()
MsgBox("record inserted")
Catch ex As Exception

End Try
conn.Close()


End Sub
End ClassSigh | :sigh:
AnswerRe: cant add to database Pin
Colin Angus Mackay18-Apr-07 2:33
Colin Angus Mackay18-Apr-07 2:33 
AnswerRe: cant add to database Pin
Eagle_Wizard18-Apr-07 4:59
Eagle_Wizard18-Apr-07 4:59 
AnswerRe: cant add to database Pin
njgrillo18-Apr-07 5:57
njgrillo18-Apr-07 5:57 
GeneralRe: cant add to database Pin
Colin Angus Mackay18-Apr-07 7:36
Colin Angus Mackay18-Apr-07 7:36 
QuestionPlz reply Pin
satyakala18-Apr-07 0:23
satyakala18-Apr-07 0:23 
AnswerRe: Plz reply Pin
Colin Angus Mackay18-Apr-07 2:36
Colin Angus Mackay18-Apr-07 2:36 
QuestionAll files Pin
Xmen Real 18-Apr-07 0:11
professional Xmen Real 18-Apr-07 0:11 
AnswerRe: All files Pin
Marcus J. Smith18-Apr-07 3:24
professionalMarcus J. Smith18-Apr-07 3:24 
GeneralRe: All files Pin
Xmen Real 18-Apr-07 15:22
professional Xmen Real 18-Apr-07 15:22 
GeneralChanging user settings without permission Pin
Marcus J. Smith19-Apr-07 1:54
professionalMarcus J. Smith19-Apr-07 1:54 
GeneralRe: Changing user settings without permission Pin
Xmen Real 19-Apr-07 4:07
professional Xmen Real 19-Apr-07 4:07 
GeneralRe: Changing user settings without permission Pin
Marcus J. Smith19-Apr-07 8:11
professionalMarcus J. Smith19-Apr-07 8:11 
GeneralRe: Changing user settings without permission Pin
Xmen Real 19-Apr-07 14:50
professional Xmen Real 19-Apr-07 14:50 
Questiongetpixel Pin
Taylor Kobani18-Apr-07 0:06
Taylor Kobani18-Apr-07 0:06 
AnswerRe: getpixel Pin
Dave Kreskowiak18-Apr-07 3:37
mveDave Kreskowiak18-Apr-07 3:37 
GeneralRe: getpixel Pin
Taylor Kobani20-Apr-07 23:37
Taylor Kobani20-Apr-07 23:37 
GeneralRe: getpixel Pin
Dave Kreskowiak21-Apr-07 6:50
mveDave Kreskowiak21-Apr-07 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.