databinding ( connection) Problem in web application

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jan 2009
Posts: 21
Reputation: rak4u is an unknown quantity at this point 
Solved Threads: 0
rak4u rak4u is offline Offline
Newbie Poster

databinding ( connection) Problem in web application

 
0
  #1
Jan 27th, 2009
Hi till now i am used window application in which there is no problem in connection using following code

  1. Dim cnn As SqlConnection
  2. cnn = New SqlConnection("data source=RAKESH-676DD0E1;initial catalog=rw;integrated security=SSPI")
  3. cnn.Open()
  4. Dim da As SqlDataAdapter
  5. Dim dt As New DataTable
  6. da = New SqlDataAdapter("select * from publicity", cnn)
  7. da.Fill(dt)
  8. DataGrid1.DataSource = dt
  9. cnn.Close()

As i am not using userid & password instead i am using window authentication

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

Stack Trace:


[OleDbException (0x80040e4d): Login failed for user 'RAKESH-676DD0E1\ASPNET'.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
webshoppe.WebForm3.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webshoppe\WebForm3.aspx.vb:154
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


please help.......
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: databinding ( connection) Problem in web application

 
0
  #2
Jan 27th, 2009
I'm sure you using SQL Server 2000
So, the error is you didn't give some permission to ASP.NET user who trying access SQL instance, therefore it blocked.
From server security in SQL Server Enterprise Manager, logins right click and add ASPNET user with windows authentication type.
Try running the application again then tell me what happened.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 21
Reputation: rak4u is an unknown quantity at this point 
Solved Threads: 0
rak4u rak4u is offline Offline
Newbie Poster

Re: databinding ( connection) Problem in web application

 
0
  #3
Jan 28th, 2009
Thanks RamyMahrous it is working now

thanks alot
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC