Hi,
I want to use VB.NET to connect to sql server remotely and input and receive data from the server. Can anyone help me to do it? I really appreciate code example. Thank you very much!!
hjdaniel.sun
0
Newbie Poster
Recommended Answers
Jump to PostWelcome hjdaniel.sun.
Here are steps:
1. Create or Open Project (application)
2. Import System.Data.SqlClient and System.Data namespaces.
3. Create an instance of SqlConnection classSub Test() Dim Cn as New System.Data.SqlClient.SqlConnection cn.ConnectionString="Data Source=servername;Initial Catalog=databasename;User Id=username;Password=password" cn.Open() .... cn.Close() End Sub
All 3 Replies
kvprajapati
1,826
Posting Genius
Team Colleague
hjdaniel.sun
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
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.