Click here to Skip to main content
15,917,321 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating MMC snap-in? Pin
esjq6-Feb-05 20:53
esjq6-Feb-05 20:53 
Generalupdate doesn't update database Pin
xrado5-Feb-05 23:14
xrado5-Feb-05 23:14 
GeneralRe: update doesn't update database Pin
Heath Stewart6-Feb-05 7:10
protectorHeath Stewart6-Feb-05 7:10 
GeneralEditing custom file formats Pin
Gleb Belov5-Feb-05 22:48
Gleb Belov5-Feb-05 22:48 
GeneralRe: Editing custom file formats Pin
Robert Rohde5-Feb-05 23:31
Robert Rohde5-Feb-05 23:31 
GeneralRe: Editing custom file formats Pin
Gleb Belov6-Feb-05 3:41
Gleb Belov6-Feb-05 3:41 
GeneralRe: Editing custom file formats Pin
mav.northwind6-Feb-05 3:51
mav.northwind6-Feb-05 3:51 
GeneralRe: Editing custom file formats Pin
Gleb Belov6-Feb-05 4:04
Gleb Belov6-Feb-05 4:04 
GeneralRe: Editing custom file formats Pin
Dave Kreskowiak7-Feb-05 4:08
mveDave Kreskowiak7-Feb-05 4:08 
Question[Are these maybe Macros ?? ] How can i do it? Pin
Anonymous5-Feb-05 22:07
Anonymous5-Feb-05 22:07 
AnswerRe: [Are these maybe Macros ?? ] How can i do it? Pin
Heath Stewart6-Feb-05 6:56
protectorHeath Stewart6-Feb-05 6:56 
QuestionNetwork Monitoring in C#? Pin
TroyPalmer5-Feb-05 21:53
TroyPalmer5-Feb-05 21:53 
AnswerRe: Network Monitoring in C#? Pin
TroyPalmer8-Feb-05 11:38
TroyPalmer8-Feb-05 11:38 
Generalthreadsafe / static, general utilities Pin
pkellner5-Feb-05 20:32
pkellner5-Feb-05 20:32 
I'm wondering what the best threadsafe way to create and use general purpose routines like special date functions, special user calculations, etc. Up until now, what I have been doing is to create a file call myutils.cs that looks something like the code below. I can call it without instantiating it because it is static which is very convienient. I am calling these routine from multiple threads and my app is crashing so I'm concerned I may have made a fatal mistake.

Could someone enlighten me please if what I am doing is major bad? Or, possibly suggest a better way to do the common things.

Thanks

Peter




public class PolarUtils
{

public static int[] HillsForUser(string currentUserId)
{

SqlConnection sqlConnection = PolarUtils.GetNewSqlConnection();
sqlConnection.Open();
string sqlSelectString = "SELECT id_hill FROM HillFile ";
sqlSelectString += " WHERE UserId = '" + currentUserId + "'";

SqlCommand sqlCom
...

public static SqlConnection GetNewSqlConnection()
{
SqlConnection sqlConnection1 = new SqlConnection();
string str = null;




GeneralRe: threadsafe / static, general utilities Pin
Heath Stewart6-Feb-05 6:43
protectorHeath Stewart6-Feb-05 6:43 
GeneralRe: threadsafe / static, general utilities Pin
pkellner6-Feb-05 12:21
pkellner6-Feb-05 12:21 
GeneralRe: threadsafe / static, general utilities Pin
Heath Stewart7-Feb-05 6:31
protectorHeath Stewart7-Feb-05 6:31 
GeneralRe: threadsafe / static, general utilities Pin
Heath Stewart6-Feb-05 6:48
protectorHeath Stewart6-Feb-05 6:48 
GeneralRe: threadsafe / static, general utilities Pin
pkellner6-Feb-05 12:19
pkellner6-Feb-05 12:19 
QuestionDifferent ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster5-Feb-05 20:07
DaMagicMaster5-Feb-05 20:07 
AnswerRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart6-Feb-05 6:42
protectorHeath Stewart6-Feb-05 6:42 
AnswerRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster6-Feb-05 16:39
DaMagicMaster6-Feb-05 16:39 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart7-Feb-05 6:35
protectorHeath Stewart7-Feb-05 6:35 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster7-Feb-05 12:50
DaMagicMaster7-Feb-05 12:50 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart7-Feb-05 15:39
protectorHeath Stewart7-Feb-05 15:39 

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.