Jump to content

Insert Into Database From Textbox, How ?


madsovenielsen
 Share

Recommended Posts

  • 1 month later...

Hi madsovenielsen, If you want to insert data to access db ,I think you can use ADO.NET (import System.Data.OleDb). Some code as follows:

	  Imports System.Data.OleDbModule Module1	Sub Main()		Dim value as String		value = TextBox1.Text 		Dim con As OleDbConnection = New OleDbConnection		Dim cmd As OleDbCommand = New OleDbCommand		con.ConnectionString = ""  'setting connectionString	  		cmd.CommandText = ""	  'setting sql insert statement with value		cmd.Connection = con		con.Open()		cmd.ExecuteNonQuery()		cmd.Dispose()		con.Close()		con.Dispose()	End SubEnd Module

If you still have any doubt and concern about this issue, please let me know. :)

Edited by AlexYan
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...