March 29th, 2006, 03:54 AM #1
- Join Date
- Mar 2006
connection between vb.net and mysql
i have a problem here...i've already created a registration form using vb.net and i used mysql as the database...but i dont know how the input/data from the registration form can be send to the database...is there anyone know the code???
March 29th, 2006, 04:05 AM #2
Umm... first off you need to D/L and install the MyOLEDB driver from the MySQL site - I think....
Then the code you would use would look something like this....
Dim fdCon As New OleDb.OleDbConnection("Provider=MySQLProv;Data Source=DATABASE;User Id=YOURSQLUSERNAME;Password=YOURSQLPASSWORD;") Dim fdCom As New OleDb.OleDbCommand("", fdCon) fdCom.Connection.Open() Dim fdRead As OleDb.OleDbDataReader = fdCom.ExecuteReader(CommandBehavior.CloseConnection) fdCom.CommandText = "INSERT INTO TABLENAME (FIELDNAME1, FIELDNAME2) VALUES ('" & ImaVar1 & "', '" & ImaVar2 & "')" fdCom.ExecuteNonQuery() fdCon.Close()Bluegrass ROCKS!!!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By rex028 in forum Webmastering and ProgrammingReplies: 5Last Post: March 6th, 2012, 06:10 AM
By Vagabond in forum General Gaming DiscussionReplies: 15Last Post: December 23rd, 2005, 11:43 AM
By Vagabond in forum Networking and InternetReplies: 2Last Post: December 16th, 2005, 09:52 AM
By Sterling in forum Webmastering and ProgrammingReplies: 3Last Post: October 15th, 2005, 08:51 AM
By neillsmob in forum Networking and InternetReplies: 11Last Post: February 21st, 2005, 07:51 PM