hey guys plzzzzzzzzzzzzz zzzzzz help me. i am trying to do a simple program on C SHARP databases using sql server but i ma getting an exception , it requires open and available connection, sql server does not exist whereas the sql server icon on my task bar says that status is Running. plzzzzzzzzzzzz help.
sql server access denied or does not exist problem
Collapse
X
-
Tags: None
-
Originally posted by bharadwajAccess is denied will come for the following situations.
1.Due to network failure.
2. Bcos of authentication and the password while registering the instance of sql server.
3.Add the instance in client network utility.
hope this will help u.
hey firstly thanks for yr response. you were too technical , i mean i still don't know how to go about the problem as to what needs to be donce actually. i am new to sql server tooo.Comment
-
i dont no abt Csharp.
but i found the following code in google.hope this will help u.in this code i have commented the code contains how check the connectivity
[code=cpp]
using System;
using System.Data.Sql Client;
using System.Data.Sql Types;
using SeminarsInfo.Da taAccessor;
using SeminarsInfo.Ut il;
namespace SeminarsInfo.Tr ansformer
{
/// <summary>
/// Summary description for SeminarsInfoTra nsformer.
/// </summary>
public class SeminarsInfoTra nsformer
{
public SeminarsInfoTra nsformer()
{
//
// TODO: Add constructor logic here
//
}
public DBProcess dbProcess = null;
public stringSQLString =
string.Empty;
public void DBconnection()
{
dbProcess = new DBProcess();
try
{
--for connecting the following code will work
dbProcess.Creat eConnection(tes t.server, test.database, test.usr, test.pwd);
}
catch(System.Da ta.SqlClient.Sq lException sqlExp)
{
throw sqlExp;
}
}
public void CreateDataReade r(string SQLString)
{
dbProcess.selec tDataInReader(S QLString);
}
//public void FetchSemInfo()
//{
//dbProcess = new DBProcess();
//try
//{
//dbProcess.Creat eConnection(tes t.server, test.database, test.usr, test.pwd);
//}
//catch(System.Da ta.SqlClient.Sq lException sqlExp)
//{
//throw sqlExp;
//}
//
//SQLString=
"SELECT * FROM table";
//dbProcess.selec tDataInReader(S QLString);
//}
}
}[/code]Comment
-
Originally posted by manisha khabranihey guys plzzzzzzzzzzzzz zzzzzz help me. i am trying to do a simple program on C SHARP databases using sql server but i ma getting an exception , it requires open and available connection, sql server does not exist whereas the sql server icon on my task bar says that status is Running. plzzzzzzzzzzzz help.
Make sure the account you are using is added to the sql database and has the appropriate permissions. Regardless of whether you are using windows authentication or a sql account you must add the user to the database and set the permissions.
If you are still having issues please post your connection string and tell us what kind of security you have.Comment
Comment