Server Error in '/shiva/datagrd' Application.
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
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: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Source Error:
Line 40: //SqlDataAdapter da=new SqlDataAdapter("select * from sms",con);
Line 41: DataSet ds=new DataSet();
Line 42: da.Fill(ds,"tab");
Line 43: DataGrid1.DataSource=ds.Tables[0].DefaultView;
Line 44: DataGrid1.DataBind();
Source File:e:\shiva\datagrd\webform1.aspx.cs Line:42
Stack Trace:
[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.]
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, String srcTable)
datagrd.WebForm1.Page_Load(Object sender, EventArgs e) in e:\shiva\datagrd\webform1.aspx.cs:42
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
please provide the solution.
What is your sql connection string in your web application?
|||string strCon="Provider=SQLOLEDB.1;User ID=sa;Initial Catalog=Anjali;Data Source=MIPL0121;Persist Security Info=False"; //my connection string
and it is existing i am able to see the data through microsoft sql server --> enterprise manager
and i am able to get the data for my windows applications but not for web application why?
|||You would have to use:
String strCon = "Server=MIPL0121;Database=Anjali;User ID=myuser;password=mypassword;"
|||still problem is like that only
i think problem with some other one not with connection string
https://secure.experts-exchange.com/register.jsp?srid=m6c%2BKpauvxfudZgRmo%2Fm6A%3D%3D&rsid=20&viewQuestionRedirectURL=%2FDatabase%2FOracle%2FQ_20402341.html%3Fqid%3D20402341%26qid%3D20402341&submit=
my problem is exact as this
Hi,
This is definately a security issue. In you connection string, you're using the Windows integrated authentication to connection to the server.
You can do this in the VS.NET because it is using your windows identity(Running under your account). However, the ASP.NET app is running under the ASPNET account, which doesn't have that previlege.
To resolve this, you can either give the ASPNET account proper permission to access the database, or use other accounts for accessing the database.
|||but i am able to get the data from remote server using same connection string in vs2005 but not in 2003 why?|||at the same time i am not able to get the data from ORACLE also and the connection string and code is perfectly executing on my neighbor system.|||at the same time i am not able to get the data from ORACLE also andthe connection string and code is perfectly executing on my neighborsystem with the same setting|||Hi,
I'd like to know if you're connecting from VS.NET IDE using this connection string. Or you're using this connection string in your ASP.NET application.
Because in different scenarios, it holds different user credentials. Also, please check if you have used the correct OleDb driver to do the connection to SQL Server.
|||ya i am using this connection string in asp.net application
but i tryied by using vs.net IDE(using Wizards) also its givng the same error when i am connecting throw wizards it is connecting and showing the database contents(mean if a select a tabe it
showing the discription of that table ) but when i am running the application it giving the above error
No comments:
Post a Comment