Hi
I am trying to bind data in my SQL database to a datagrid in MS Visual Basic.net on my local machine
I have set up the connection ok and if I run Data\Preview Data, in MS Visual Basic.net I can see the expected fields and colums no problem.
However when I build and browse the web page I get the error listed below:
I have tried using both SQLDataAdapter1 and OleDbDataAdapter1 both give me the same error.
I have created a dataset called dsCategories and bound it to the datasource property of my datagrid.
I am connecting to my SQL database with SQL authentication as I cannot seem to create a connection using windows authentication.
Line 92 is where it is highlighted when the error comes up.
I am running IIS on my local machine.
Any advice will be greatly appreciated.
Regards
Redcare
Server Error in '/WebDataEntry' Application.
--------------------------------------------------------------------------------
Login failed for user 'sa'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'sa'.
Source Error:
Line 90: 'Put user code to initialize the page here
Line 91: If Not IsPostBack Then
Line 92: OleDbDataAdapter1.Fill(DsCategories1)
Line 93: DataGrid1.DataBind()
Line 94: End If
Source File: C:\Inetpub\ Line: 92
Stack Trace:
[OleDbException (0x80040e4d): Login failed for user 'sa'.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
WebDataEntry.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\ System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
I am trying to bind data in my SQL database to a datagrid in MS Visual Basic.net on my local machine
I have set up the connection ok and if I run Data\Preview Data, in MS Visual Basic.net I can see the expected fields and colums no problem.
However when I build and browse the web page I get the error listed below:
I have tried using both SQLDataAdapter1 and OleDbDataAdapter1 both give me the same error.
I have created a dataset called dsCategories and bound it to the datasource property of my datagrid.
I am connecting to my SQL database with SQL authentication as I cannot seem to create a connection using windows authentication.
Line 92 is where it is highlighted when the error comes up.
I am running IIS on my local machine.
Any advice will be greatly appreciated.
Regards
Redcare
Server Error in '/WebDataEntry' Application.
--------------------------------------------------------------------------------
Login failed for user 'sa'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'sa'.
Source Error:
Line 90: 'Put user code to initialize the page here
Line 91: If Not IsPostBack Then
Line 92: OleDbDataAdapter1.Fill(DsCategories1)
Line 93: DataGrid1.DataBind()
Line 94: End If
Source File: C:\Inetpub\ Line: 92
Stack Trace:
[OleDbException (0x80040e4d): Login failed for user 'sa'.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
WebDataEntry.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\ System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731