Hi till now i am used window application in which there is no problem in connection using following code
As i am not using userid & password instead i am using window authenticationCode:Dim cnn As SqlConnection cnn = New SqlConnection("data source=RAKESH-676DD0E1;initial catalog=rw;integrated security=SSPI") cnn.Open() Dim da As SqlDataAdapter Dim dt As New DataTable da = New SqlDataAdapter("select * from publicity", cnn) da.Fill(dt) DataGrid1.DataSource = dt cnn.Close() Dim cnn As SqlConnection cnn = New SqlConnection("data source=RAKESH-676DD0E1;initial catalog=rw;integrated security=SSPI") cnn.Open() Dim da As SqlDataAdapter Dim dt As New DataTable da = New SqlDataAdapter("select * from publicity", cnn) da.Fill(dt) DataGrid1.DataSource = dt cnn.Close()
But now i develop web application & used this code & also tried .NET toolbox oledbdataadpter & dataset but when I debug my application then the connection will be failed & show message
Server Error in '/webshoppe' Application.
--------------------------------------------------------------------------------
Login failed for user 'RAKESH-676DD0E1\ASPNET'.
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 'RAKESH-676DD0E1\ASPNET'.
Source Error:
Line 152: 'Put user code to initialize the page here
Line 153:
Line 154: OleDbDataAdapter1.Fill(DataSet11)
Line 155: End Sub
Line 156:
Source File: c:\inetpub\wwwroot\webshoppe\WebForm3.aspx.vb Line: 154




Reply With Quote