Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Connecting a Winform to sql server

Author  Topic 

eliastannoury
Starting Member

11 Posts

Posted - 2006-05-17 : 05:59:47
ok, can anyone help me in giving me general ideas, or references on how to connect .net to an sql server please?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-10 : 16:29:49
oh. datareader object. ADO.Net connectivity.

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

cmdr_skywalker
Posting Yak Master

159 Posts

Posted - 2006-06-11 : 20:37:14
This is really a .Net Forum but we are generous guys so here it is:
/*if your using the code*/
Imports System.data.sqlclient namespace.

private procedure Test
begin
Dim sqlConn As SqlConnection
Dim sqlCmd As SqlCommand
Dim sSQL As String

sqlConn = New SqlConnection("Server=" & GetServerName() & ";uid=" & GetDBUser & ";pwd=" & GetUserPassword() & ";database=master;Connect Timeout=5;")
sqlConn.Open()
sSQL = "select 1"
sqlCmd = New SqlCommand(sSQL, sqlConn)
sqlCmd.CommandType = CommandType.Text
sqlCmd.ExecuteNonQuery()
sqlCmd.Dispose()
sqlConn.Close()
End

/* if your using the Forms, use the Data Controls (see toolbox) */


May the Almighty God bless us all!
Go to Top of Page

cmdr_skywalker
Posting Yak Master

159 Posts

Posted - 2006-06-11 : 20:38:39
forgot to comment out "namespace" :).
It should be:
Imports System.data.sqlclient

May the Almighty God bless us all!
Go to Top of Page
   

- Advertisement -