Click here to Skip to main content
15,920,576 members
Home / Discussions / C#
   

C#

 
GeneralRe: convert vb.net to c# Pin
toto_201015-Apr-10 0:08
toto_201015-Apr-10 0:08 
AnswerRe: convert vb.net to c# Pin
Eddy Vluggen14-Apr-10 23:57
professionalEddy Vluggen14-Apr-10 23:57 
GeneralRe: convert vb.net to c# Pin
toto_201015-Apr-10 0:42
toto_201015-Apr-10 0:42 
GeneralRe: convert vb.net to c# Pin
Eddy Vluggen15-Apr-10 0:45
professionalEddy Vluggen15-Apr-10 0:45 
GeneralRe: convert vb.net to c# Pin
toto_201015-Apr-10 1:11
toto_201015-Apr-10 1:11 
AnswerRe: convert vb.net to c# Pin
Pete O'Hanlon15-Apr-10 2:37
mvePete O'Hanlon15-Apr-10 2:37 
AnswerRe: convert vb.net to c# Pin
thatraja28-Jan-12 5:52
professionalthatraja28-Jan-12 5:52 
QuestionHelp on changing Text value Pin
Saiyed Alam14-Apr-10 21:38
Saiyed Alam14-Apr-10 21:38 
AnswerRe: Help on changing Text value Pin
Michel Godfroid14-Apr-10 21:47
Michel Godfroid14-Apr-10 21:47 
GeneralRe: Help on changing Text value Pin
Saiyed Alam14-Apr-10 22:16
Saiyed Alam14-Apr-10 22:16 
GeneralRe: Help on changing Text value Pin
Michel Godfroid14-Apr-10 22:32
Michel Godfroid14-Apr-10 22:32 
QuestionMap Control Pin
kjsl2k914-Apr-10 21:35
kjsl2k914-Apr-10 21:35 
AnswerRe: Map Control Pin
Keith Barrow14-Apr-10 23:20
professionalKeith Barrow14-Apr-10 23:20 
AnswerRe: Map Control Pin
Bernhard Hiller16-Apr-10 3:08
Bernhard Hiller16-Apr-10 3:08 
Questiondatabase connection error with sa user in SQL Express 2005 Pin
Chesnokov Yuriy14-Apr-10 20:54
professionalChesnokov Yuriy14-Apr-10 20:54 
I've got 2 connection strings:

1. "Data Source=.\SQLEXPRESS;
User Id=sa;Password=hello;
AttachDbFilename=C:\inetpub\wwwroot\MySite\dbs\MyDb.mdf;
Connect Timeout=30"

2. "Data Source=.\SQLEXPRESS;
AttachDbFilename=C:\inetpub\wwwroot\MySite\dbs\MyDb.mdf;
Integrated Security=True;Connect Timeout=30;User Instance=True"


2nd is working perfectly for db connection,
but using 1st returns that error:

System.Data.SqlClient.SqlException: 
Unable to open the physical file "C:\inetpub\wwwroot\MySite\dbs\MyDb.mdf". 
Operating system error 5: "5(Access Denied)".
An attempt to attach an auto-named database for file
C:\inetpub\wwwroot\MySite\dbs\MyDb.mdf failed. 
A database with the same name exists, 
or specified file cannot be opened, 
or it is located on UNC share.


In SQL Server COnfiguration Manager I enabled all services
and protocols - SQL Server (SQLEXPRESS), SQL Server Browser,
Shared Memory, Named Pipes, TCP/IP, VIA.

In SQL Server Management Studio Express sa/hello user is present
and Server Properties->Security - SQL Server and Windows Authentication mode

If I put incorrect password in 1st connection string it reports password error.

Here is the code to connect to db and get some records just for a sake:
SqlConnection con = new SqlConnection(this.connection);
SqlDataAdapter da = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();                        
int nRows = da.Fill(ds, "Persons");

Чесноков

AnswerRe: database connection error with sa user in SQL Express 2005 Pin
Stanciu Vlad14-Apr-10 22:12
Stanciu Vlad14-Apr-10 22:12 
AnswerRe: database connection error with sa user in SQL Express 2005 Pin
Chesnokov Yuriy14-Apr-10 23:07
professionalChesnokov Yuriy14-Apr-10 23:07 
GeneralRe: database connection error with sa user in SQL Express 2005 Pin
Stanciu Vlad15-Apr-10 0:07
Stanciu Vlad15-Apr-10 0:07 
GeneralRe: database connection error with sa user in SQL Express 2005 Pin
Chesnokov Yuriy15-Apr-10 0:55
professionalChesnokov Yuriy15-Apr-10 0:55 
GeneralRe: database connection error with sa user in SQL Express 2005 Pin
Stanciu Vlad15-Apr-10 1:04
Stanciu Vlad15-Apr-10 1:04 
Questiondatagridview Pin
ali_reza_zareian14-Apr-10 20:02
ali_reza_zareian14-Apr-10 20:02 
AnswerRe: datagridview Pin
thatraja14-Apr-10 20:14
professionalthatraja14-Apr-10 20:14 
AnswerRe: datagridview Pin
Not Active14-Apr-10 20:16
mentorNot Active14-Apr-10 20:16 
Questionhow to bind data to datagridview which has combobox and checkbox columns Pin
NarVish14-Apr-10 19:24
NarVish14-Apr-10 19:24 
AnswerRe: how to bind data to datagridview which has combobox and checkbox columns Pin
Abhinav S14-Apr-10 19:36
Abhinav S14-Apr-10 19:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.