Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
i can use following code but not work in VB.NET
Using System.Data.SqlClinet;
 
SqlConnection con;
SqlCommand cmd;
Posted 1-Nov-11 3:53am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You are using C# Syntax.
 
Have a look at below link for VB.Net syntax.
http://www.daniweb.com/software-development/vbnet/code/216920
  Permalink  
v2
Comments
Espen Harlinn at 1-Nov-11 13:21pm
   
Nice link, my 5
RaisKazi at 2-Nov-11 0:47am
   
Thank you Espen. :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try
 
Dim con As New SqlConnection()
Dim cmd As New SqlCommand()
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

If you need help with connection strings, go to http://www.connectionstrings.com/[^]. You can pick up the right database you are looking for.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

 using cn as new sqlconnection(ConnectionString)
 end using
 
or
 
 dim cn as new sqlconnection("ConnectionString")
 

Have a read of this article it will show you how to make a connection to a SQL Server database. MSDN: Sqlconnection[^]
 
This article will show you how to execute a command against the database using sqlcommand MSDN: Sqlcommand[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 397
1 OriginalGriff 380
2 Shai Vashdi 280
3 Emre Ataseven 135
4 Abhinav S 128
0 Sergey Alexandrovich Kryukov 8,894
1 OriginalGriff 5,200
2 Peter Leow 3,955
3 Maciej Los 3,535
4 Abhinav S 3,208


Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 1 Nov 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid