Wednesday, March 21, 2012
Error: 18456, Severity: 14, State: 16.
2005 from a c#.NET console app. Did you figure it out?
"payyans" wrote:
[vbcol=seagreen]
> The application was able to make connections using the same credentials in
> the initial hours of run. So, I am not sure why permission is denied at a
> later point. Thanks for the response.
> -payyans
> "Russell Fields" wrote:
Not yet.
-payyans
"jt" wrote:
[vbcol=seagreen]
> I'm getting the same error trying to connect for the first time in SQL Server
> 2005 from a c#.NET console app. Did you figure it out?
> "payyans" wrote:
Sunday, February 26, 2012
Error with databound datagrid
Help,
I have a simple app that only has on datagrid that is bound by the typical sqlconnection,sqldataadapter and dataset. But I keep getting this error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
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 '(null)'. Reason: Not associated with a trusted SQL Server connection.
Source Error:
|
WHY :)
xactly what the message says..can you post the connection string ?
|||Indeed, fix your connectionstring. Get that working before messing withdatagrids. The error indicates that you're telling ADO.NET to use atrusted connection (i.e. windows authentication) but the ASPNET useraccount probably doesn't have access to your database. I typically useSQL authentication so I can limit the damage each application can do.One account per database.
error with connection with SQL SERVER
I am developing web application.
I have connected my app. with sql server using web.config as code given below using Named pipe connection
<appSettings>
<add key="constring" value="Server=ebserver;UID=sa;database=Airport-Clearance;Integrated Security=SSPI;network library=dbnmpntw;" />
</appSettings
After than i have added a new CLASS in my app.
in that, I have written as given below code.
public SqlConnection GetConnection()
{
System.Configuration.AppSettingsReader objApp = new System.Configuration.AppSettingsReader ();
SqlConnection sqlconn = new SqlConnection ();
sqlconn.ConnectionString = Convert.ToString(objApp.GetValue("constring", typeof(string)));
return sqlconn ;
}
Finally, In load event of form, I have written as below code.
Class1 objcs = new Class1() ;
SqlConnection sqlconn = objcs.GetConnection ();
SqlDataAdapter filling = new SqlDataAdapter("select * from Airport",sqlconn);
DataSet ds = new DataSet();
sqlconn.Open();
//filling.Fill(ds,"Airport");
//DataGrid dg = new DataGrid();
dg.DataSource = ds.Tables["Airport"];
dg.DataBind();
//Do what ever
sqlconn.Close ();
When i run this application
It gives error like
provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
If i use try catch then it doesnt display any error.but Even it doesnt display datagrid on form.
Please give me solution.
Even how to run app. line by line as we run in VB using F8.
Reply please,
Regards,
ASIFTry this instead (assuming you're not using beta version):
public SqlConnection GetConnection()
{
SqlConnection sqlconn = new SqlConnection ();
sqlconn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["constring"].ConnectionString;
return sqlconn ;
}
Friday, February 24, 2012
Error while using first time!
I'm trying to learn about SQL databases and use them for my asp.net app sine I cant get the hang of MySQL in ASP. Every time I go to create a new SQL Database it saids: Would you like to place it in the App_Data folder basicly and I say yes. Then the error:
Unable to find DbProivderFactory for type System.Data.SqlClient.SqlConnection
Hi Clanstyles,
Based on the error message, I think the provider factory was not installed properly on you machine. Or the configuration files might not be written correctly.
Please try the following:
1. Open machine.config file under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
2. Check the nodes under configuration/system.data/DbProviderFactories to see if all the provider has been installed successfully. It has to look like this.
<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</DbProviderFactories>
HTH.