i try to create an application that can sent the value from vb.net to SQL database..
the problem is i dont know how....i created the interface, just a simple one like inserting name, D.O.B, hobbies & phone nmber(all this using text area)...and a submit button...
pleaseeeeee........... help me :'(
-im still a padawan not a sith lord-
gabanxx 0 Light Poster
Recommended Answers
Jump to Postadd this code to module to connected sqlserver with vb.net:
Imports System.Data Imports System.Data.SqlClient Module Koneksi Public conn As SqlConnection Public Function GetConnect() conn = New SqlConnection("server = MyServerName;database = MyDatabaseName;Trusted_Connection = yes") Return conn End Function End Module
add this code to button event click :
…
Jump to Postfor more complete see my snippet :
- Show Data in DataGrid with VB.Net 2003 and SQLServer 2000
- Save, Edit, Delete Data using VB.Net and SQL Server 2000
Jump to PostvarCommand = New SqlCommand("insert into tbl_rop values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "',)", varConnection)
Wrong code, where u want to insert?what column Name of table?
eg :cmdStudent1.CommandText = "INSERT INTO Student(Id, FirstName, LastName,Age) VALUES('" & Trim(txtId.text) …
Jump to Postyou're Welcome...
Don't forget to mark this thread solved.
Happy Coding Friend :)
All 13 Replies
Jx_Man 987 Nearly a Senior Poster Featured Poster
november_pooh commented: Nice code +1
ITKnight commented: how great this code :) +1
Vega_Knight commented: nice one... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
gabanxx 0 Light Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster
gabanxx 0 Light Poster
gabanxx 0 Light Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster
gabanxx 0 Light Poster
Pja 0 Newbie Poster
gebrehiwet 0 Newbie Poster
gebrehiwet 0 Newbie Poster
shubhadip 0 Newbie Poster
shubhadip 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.