gtsikes
07-27-2004, 04:38 PM
Greetings,
When I try to use the .Net data provider namespace System.Data.SqlClient on my ASP.Net pages. I get the error SQL Server does not exist or access denied. If I change my code to use System.Data.ODBC and use the corresponding Object model for ODBC, my pages work great. I have an SQL2000 server with SP3 running on my corporate WAN and a seperate Web server with the 1.1 framework. All ASP pages work fine using ADO and ODBC or SQLOLEDB, but ASP.Net only works with ODBC. I would like to eliminate the ODBC layer. I have tried using integrated security and SQL authenication. Any ideas?
This would be a typical snippet for a datagrid's databinding.
sub BindData()
Dim connectionString As String = "server='UWQJAXCNV01'; trusted_connection=true; database='ucd'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT * FROM jerry.customer"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet("Cust_List")
dataAdapter.Fill(dataSet)
DataGrid1.datasource = _
dataSet.Tables("Cust_List").Defaultview
DataGrid1.databind
end sub
Thanks,
Jerry
When I try to use the .Net data provider namespace System.Data.SqlClient on my ASP.Net pages. I get the error SQL Server does not exist or access denied. If I change my code to use System.Data.ODBC and use the corresponding Object model for ODBC, my pages work great. I have an SQL2000 server with SP3 running on my corporate WAN and a seperate Web server with the 1.1 framework. All ASP pages work fine using ADO and ODBC or SQLOLEDB, but ASP.Net only works with ODBC. I would like to eliminate the ODBC layer. I have tried using integrated security and SQL authenication. Any ideas?
This would be a typical snippet for a datagrid's databinding.
sub BindData()
Dim connectionString As String = "server='UWQJAXCNV01'; trusted_connection=true; database='ucd'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT * FROM jerry.customer"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet("Cust_List")
dataAdapter.Fill(dataSet)
DataGrid1.datasource = _
dataSet.Tables("Cust_List").Defaultview
DataGrid1.databind
end sub
Thanks,
Jerry