| | |
Connecting VB .NET with SQL Dbase
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
Have you ever tried googling?
http://www.google.com/search?q=VB.NE...ver%22+connect
gave a plenty of examples.
http://www.google.com/search?q=VB.NE...ver%22+connect
gave a plenty of examples.
Teme64 @ Windows Developer Blog
•
•
Join Date: Sep 2008
Posts: 3
Reputation:
Solved Threads: 0
Import the SqlClient first.
Then Establish the connection by
Then Establish the connection by
VB.NET Syntax (Toggle Plain Text)
Sqlconnection conn=new Sqlconnection(); SqlCommand cmd=new SqlCommand("Query",conn); cmd.ExecuteNonQuery();
See this site....
There are all about connection string to databases..
Just looking what you needed there.
There are all about connection string to databases..
Just looking what you needed there.
Last edited by Jx_Man; Sep 11th, 2008 at 12:05 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Sep 2008
Posts: 36
Reputation:
Solved Threads: 0
A simple Insert Statement Function made by me for another project.
Hope i helped!
VB.NET Syntax (Toggle Plain Text)
Function Insert(ByRef Conn As OleDbConnection, ByRef connection_string As String, ByRef Transaction As OleDbTransaction, ByRef ConnCommand As OleDbCommand, ByRef CommandText As String) Dim da As New OleDbDataAdapter Conn = New OleDbConnection(connection_string) Conn.Open() Transaction = Conn.BeginTransaction ConnCommand.Connection = Conn ConnCommand.Transaction = Transaction ConnCommand.CommandText = CommandText Try da.InsertCommand = ConnCommand da.InsertCommand.ExecuteNonQuery() Transaction.Commit() MessageBox.Show("Saved succesfully", "Adding Data", MessageBoxButtons.OK, MessageBoxIcon.Information) Catch ex As Exception Transaction.Rollback() MessageBox.Show(ex.Message) End Try Conn.Close() ConnCommand.Dispose() da.Dispose() Transaction.Dispose() Return Nothing End Function
Hope i helped!
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: End of Statement Expected
- Next Thread: ReadLine Question, URGENT
| Thread Tools | Search this Thread |
"crystal .net .net2005 2008 access add advanced application array assignment basic beginner box button buttons center click client code combo convert cpu data database datagrid datagridview designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall forms html image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity pan picturebox picturebox2 port print printpreview record regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase sqlserver storedprocedure string temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winsock wpf wrapingcode xml






