L
Lasse Edsvik
Hello
I made a .udl file and tested its connectionstring and it worked, when i put
the connectionstring in the code it says that it is invalid? what have i
done wrong?
<%@ Page Language="vb" debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
BindData()
End Sub
Sub BindData()
Dim conn as new
SqlConnection(ConfigurationSettings.AppSettings("Provider=SQLOLEDB.1;Persist
Security Info=False;User ID=myuser;Password=mypass;Initial Catalog=lab;Data
Source=192.168.8.5"))
const strsql as String = "myTestProc"
Dim mycomm as New SqlCommand(strsql,conn)
conn.open()
test.Datasource =
mycomm.ExecuteReader(CommandBehavior.CloseConnection)
test.Databind()
End Sub
</script>
<html>
<head>
</head>
<body>
<asp:datagrid id="test" runat="server"></asp:datagrid>
</body>
</html>
I made a .udl file and tested its connectionstring and it worked, when i put
the connectionstring in the code it says that it is invalid? what have i
done wrong?
<%@ Page Language="vb" debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
BindData()
End Sub
Sub BindData()
Dim conn as new
SqlConnection(ConfigurationSettings.AppSettings("Provider=SQLOLEDB.1;Persist
Security Info=False;User ID=myuser;Password=mypass;Initial Catalog=lab;Data
Source=192.168.8.5"))
const strsql as String = "myTestProc"
Dim mycomm as New SqlCommand(strsql,conn)
conn.open()
test.Datasource =
mycomm.ExecuteReader(CommandBehavior.CloseConnection)
test.Databind()
End Sub
</script>
<html>
<head>
</head>
<body>
<asp:datagrid id="test" runat="server"></asp:datagrid>
</body>
</html>