Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
QuestionProblem saving changes to a database VS C# 2005 Pin
danielhasdibs28-Oct-08 8:18
danielhasdibs28-Oct-08 8:18 
AnswerRe: Problem saving changes to a database VS C# 2005 Pin
Rajasekharan Vengalil28-Oct-08 8:28
Rajasekharan Vengalil28-Oct-08 8:28 
AnswerRe: Problem saving changes to a database VS C# 2005 Pin
Paul Conrad28-Oct-08 11:08
professionalPaul Conrad28-Oct-08 11:08 
GeneralRe: Problem saving changes to a database VS C# 2005 Pin
danielhasdibs29-Oct-08 4:03
danielhasdibs29-Oct-08 4:03 
QuestionRe: Problem saving changes to a database VS C# 2005 Pin
danielhasdibs29-Oct-08 3:41
danielhasdibs29-Oct-08 3:41 
AnswerRe: Problem saving changes to a database VS C# 2005 Pin
danielhasdibs29-Oct-08 9:34
danielhasdibs29-Oct-08 9:34 
AnswerRe: Problem saving changes to a database VS C# 2005 Pin
nelsonpaixao29-Oct-08 15:19
nelsonpaixao29-Oct-08 15:19 
QuestionSQL Timeout bypass Pin
BradAW28-Oct-08 7:47
BradAW28-Oct-08 7:47 
In my c# 2005 windows form application I have a timer that pulls data from a mssql 2005 database. The query and code works fine most of the time. Occationally the sql connection will time out when connecting to the database or I'll get deadlocked by someone elses program.

What I need to change in my code so if the SQL connections has a exception it will continue to run as if nothing happened or change a label to say timeout. Since the SQL commands run on a timmer it will run again to update it shortly.

private void SQL_Timer_Tick(object sender, EventArgs e)
{

SqlConnection connection = new SqlConnection(connectionString);
connection.Open();
SqlCommand command = new SqlCommand("SELECT site from table);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
presite.Add(reader.GetString(0));
point.Add(reader.GetString(1));
}
connection.Close();
}
AnswerRe: SQL Timeout bypass [modified] Pin
PIEBALDconsult28-Oct-08 8:12
mvePIEBALDconsult28-Oct-08 8:12 
QuestionHow to access Variant object returned from COM method in C# Pin
Larry K28-Oct-08 6:29
Larry K28-Oct-08 6:29 
AnswerRe: How to access Variant object returned from COM method in C# Pin
Larry K28-Oct-08 8:37
Larry K28-Oct-08 8:37 
QuestionCall default dial up connection Pin
Hossein Afyuoni28-Oct-08 6:24
Hossein Afyuoni28-Oct-08 6:24 
QuestionUser privilege issue Pin
George_George28-Oct-08 3:53
George_George28-Oct-08 3:53 
AnswerRe: User privilege issue Pin
Mark Salsbery28-Oct-08 4:49
Mark Salsbery28-Oct-08 4:49 
GeneralRe: User privilege issue Pin
George_George28-Oct-08 4:54
George_George28-Oct-08 4:54 
QuestionRe: User privilege issue Pin
Mark Salsbery28-Oct-08 5:41
Mark Salsbery28-Oct-08 5:41 
AnswerRe: User privilege issue Pin
George_George29-Oct-08 19:19
George_George29-Oct-08 19:19 
AnswerRe: User privilege issue Pin
George_George28-Oct-08 4:54
George_George28-Oct-08 4:54 
AnswerRe: User privilege issue Pin
#realJSOP28-Oct-08 4:56
mve#realJSOP28-Oct-08 4:56 
GeneralRe: User privilege issue Pin
George_George28-Oct-08 4:58
George_George28-Oct-08 4:58 
GeneralRe: User privilege issue Pin
#realJSOP28-Oct-08 5:05
mve#realJSOP28-Oct-08 5:05 
GeneralRe: User privilege issue Pin
George_George29-Oct-08 19:18
George_George29-Oct-08 19:18 
AnswerRe: User privilege issue Pin
Le centriste28-Oct-08 6:18
Le centriste28-Oct-08 6:18 
GeneralRe: User privilege issue Pin
George_George31-Oct-08 1:36
George_George31-Oct-08 1:36 
QuestionDisabling Group Boxes Pin
Karlos_V28-Oct-08 3:37
Karlos_V28-Oct-08 3:37 

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.