problema conexion sql server client

01/07/2006 - 00:24 por edwin | Informe spam
estoy tratando de conectarme como cliente desde un web form a sqlserver
me genera error.

gracias...

Imports System.Data.SqlClient

funcion()

Dim connString As String = "Server=A**;Database=e***;User ID=e****"(no se
si esta bien o falta algo )


Dim sql As String '"SELECT * FROM a****"

Dim conn As SqlConnection = New SqlConnection(connString)
Dim command As SqlCommand = New SqlCommand(sql, conn)

Try
conn.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
Me.DataGrid1.DataSource = reader
Me.DataGrid1.DataBind()
Catch ex As Exception
' Exception handling code goes here
Finally
conn.Close()
End Try

end Funcion
 

Leer las respuestas

#1 Dany Acosta
01/07/2006 - 01:49 | Informe spam
Y cual es el Mensaje de error???

Dim connString As String = "Server=A**;Database=e***;User
ID=e****;pwd=DONDE ESTA EL PASSWORD"

edwin escribió:
estoy tratando de conectarme como cliente desde un web form a sqlserver
me genera error.

gracias...

Imports System.Data.SqlClient

funcion()

Dim connString As String = "Server=A**;Database=e***;User ID=e****"(no se
si esta bien o falta algo )


Dim sql As String '"SELECT * FROM a****"

Dim conn As SqlConnection = New SqlConnection(connString)
Dim command As SqlCommand = New SqlCommand(sql, conn)

Try
conn.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
Me.DataGrid1.DataSource = reader
Me.DataGrid1.DataBind()
Catch ex As Exception
' Exception handling code goes here
Finally
conn.Close()
End Try

end Funcion

Preguntas similares