Click here to Skip to main content
15,905,874 members
Home / Discussions / C#
   

C#

 
GeneralRe: pass picture as parameter TO C# Pin
MrKBA22-Mar-11 3:36
MrKBA22-Mar-11 3:36 
GeneralRe: pass picture as parameter TO C# Pin
BobJanova22-Mar-11 3:47
BobJanova22-Mar-11 3:47 
GeneralRe: pass picture as parameter TO C# Pin
_Erik_22-Mar-11 3:51
_Erik_22-Mar-11 3:51 
GeneralRe: pass picture as parameter TO C# Pin
MrKBA22-Mar-11 4:07
MrKBA22-Mar-11 4:07 
GeneralRe: pass picture as parameter TO C# Pin
_Erik_22-Mar-11 5:09
_Erik_22-Mar-11 5:09 
AnswerRe: pass picture as parameter TO C# Pin
Dan Mos22-Mar-11 3:13
Dan Mos22-Mar-11 3:13 
GeneralRe: pass picture as parameter TO C# Pin
MrKBA22-Mar-11 3:36
MrKBA22-Mar-11 3:36 
QuestionRe: pass picture as parameter TO C# Pin
Paladin200022-Mar-11 4:42
Paladin200022-Mar-11 4:42 
AnswerRe: pass picture as parameter TO C# Pin
MrKBA22-Mar-11 5:14
MrKBA22-Mar-11 5:14 
AnswerRe: pass picture as parameter TO C# Pin
Xmen Real 22-Mar-11 5:43
professional Xmen Real 22-Mar-11 5:43 
GeneralRe: pass picture as parameter TO C# Pin
MrKBA22-Mar-11 6:46
MrKBA22-Mar-11 6:46 
QuestionNeed to Resolve the Error In Window Scheduler Pin
Swaranjeet Singh22-Mar-11 1:02
Swaranjeet Singh22-Mar-11 1:02 
AnswerRe: Need to Resolve the Error In Window Scheduler Pin
Richard MacCutchan22-Mar-11 1:15
mveRichard MacCutchan22-Mar-11 1:15 
GeneralRe: Need to Resolve the Error In Window Scheduler Pin
Swaranjeet Singh22-Mar-11 1:38
Swaranjeet Singh22-Mar-11 1:38 
AnswerRe: Need to Resolve the Error In Window Scheduler Pin
Luc Pattyn22-Mar-11 1:48
sitebuilderLuc Pattyn22-Mar-11 1:48 
AnswerRe: Need to Resolve the Error In Window Scheduler Pin
RobCroll22-Mar-11 1:52
RobCroll22-Mar-11 1:52 
AnswerRe: Need to Resolve the Error In Window Scheduler Pin
Pete O'Hanlon22-Mar-11 2:40
mvePete O'Hanlon22-Mar-11 2:40 
GeneralRe: Need to Resolve the Error In Window Scheduler Pin
ksss_maheshece23-Mar-11 3:11
ksss_maheshece23-Mar-11 3:11 
Questionmaster form in .net winform 1.1 Pin
Swaranjeet Singh22-Mar-11 0:48
Swaranjeet Singh22-Mar-11 0:48 
AnswerRe: master form in .net winform 1.1 Pin
Eddy Vluggen22-Mar-11 1:10
professionalEddy Vluggen22-Mar-11 1:10 
AnswerRe: master form in .net winform 1.1 Pin
Wayne Gaylard22-Mar-11 1:13
professionalWayne Gaylard22-Mar-11 1:13 
QuestionC# and local SQL server connection [Solved] Pin
JoplinsSlave21-Mar-11 23:20
JoplinsSlave21-Mar-11 23:20 
Hola,

So here's the thing..

I'm using Visual Web Developer 2010 Express and SQL Server 2008, and I'm trying to connect to this goddamn database using C#.

I've created an ASP.NET Empty Website, and I've created an SQL Server Database in the project as well.

So here's how my Page_Load function looks (where I try to connect to the database):

protected void Page_Load(object sender, EventArgs e)
{
    SqlConnection sqlCon = new SqlConnection("server=localhost;database=Database;Trusted_Connection=yes;connection timeout=8");

    try
    {
        sqlCon.Open();
    }
    catch (Exception err)
    {
        errorLbl.Text = err.ToString();
    }
}


But it just won't work...
I'm obviously doing something wrong here, but what?
And what's this bullshit about username and password in the connection string? It's just a local database for god's f***ing sake!!!!

Thanks in advance,

Jop
modified on Tuesday, March 22, 2011 6:32 AM

AnswerRe: C# and local SQL server connection Pin
Pete O'Hanlon21-Mar-11 23:40
mvePete O'Hanlon21-Mar-11 23:40 
GeneralRe: C# and local SQL server connection Pin
JoplinsSlave21-Mar-11 23:53
JoplinsSlave21-Mar-11 23:53 
GeneralRe: C# and local SQL server connection Pin
Pete O'Hanlon22-Mar-11 0:04
mvePete O'Hanlon22-Mar-11 0:04 

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.