Hi i m new user in vb.net so i want plz u people help mee, i just want to conect my project to sql server database.
joharasad
0
Newbie Poster
Recommended Answers
Jump to PostHi,
Connecting the database to your project is pretty simple. some basic ideas here;
1) import "System.Data.SqlClient" namespace
2) Create SqlConnection object to establish connection with the database. connectionstring (which contains the server,user,db credentials) is required.
3) Use SqlCommand object to play with your database tables.Just have …
Jump to PostHere is a code example what MeSampath suggested:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Read an image Using conn As New System.Data.SqlClient.SqlConnection("Data Source=apex2006sql;Initial Catalog=Scott;Integrated Security=True;") conn.Open() Using cmd As New SqlClient.SqlCommand("Select Top 1 Name, CreateDate, Picture From Picture", conn) Using dr …
Jump to Postplease explain why
There are a lot of reasons
1) Security. When you manually build queries with values in the command text you open your application up for SQL Injection. If you have a query:
Insert Into tbl (Col1, Col2) Values ('a', 'b')
If the values …
All 11 Replies
MeSampath
4
Junior Poster
sknake
1,622
Senior Poster
Featured Poster
TomW
73
Posting Whiz
joharasad
0
Newbie Poster
TomW
73
Posting Whiz
jlego
15
Posting Pro
sknake
commented:
you should consider using parameterized sql
-1
sknake
1,622
Senior Poster
Featured Poster
jlego
15
Posting Pro
jhpajiri
0
Newbie Poster
jhpajiri
0
Newbie Poster
sknake
1,622
Senior Poster
Featured 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.