Monday, March 19, 2012

Im not able to connect to SQL server using ASP.NET & VS.NET

plzz help me ,
I use VS.NET --> VB.NET --> ASP.NET appln.

Database : Nortwind using SQL data adapter

And plzz let me know what are steps in connecting to database.

I've tried something but i'm getting " Login failed for user 'HOME-HG0B8FTI7Y\ASPNET'. "
error.

Some1 out dere solve this problem

Server Error in '/WebApplication6' Application.
------------------------

Login failed for user 'HOME-HG0B8FTI7Y\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.SqlClient.SqlException: Login failed for user 'HOME-HG0B8FTI7Y\ASPNET'.

Source Error:

Line 89: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 90: 'Put user code to initialize the page here
Line 91: Me.SqlDataAdapter1.Fill(Me.DataSet11.Categories)
Line 92: Me.DataBind()
Line 93: End Sub

Source File: d:\inetpub\wwwroot\WebApplication6\WebForm1.aspx.vb Line: 91

Stack Trace:

[SqlException: Login failed for user 'HOME-HG0B8FTI7Y\ASPNET'.]
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
WebApplication6.WebForm1.Page_Load(Object sender, EventArgs e) in d:\inetpub\wwwroot\WebApplication6\WebForm1.aspx.vb:91
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()Hi there,

This happens when asp.net user account doesn't have enough permissions to access the specified database. Try thislink

Hope this helps|||It is eating my brain. U gave right solution|||Glad it worked for you...

Have fun programming..:)

No comments:

Post a Comment