Click here to Skip to main content
15,895,538 members
Home / Discussions / C#
   

C#

 
Questioncreate a custom file Pin
Sasuko30-Sep-05 0:05
Sasuko30-Sep-05 0:05 
AnswerRe: create a custom file Pin
Gavin Jeffrey30-Sep-05 2:12
Gavin Jeffrey30-Sep-05 2:12 
AnswerRe: create a custom file Pin
Wjousts30-Sep-05 2:54
Wjousts30-Sep-05 2:54 
QuestionCursors in C# Pin
| Muhammad Waqas Butt |29-Sep-05 23:58
professional| Muhammad Waqas Butt |29-Sep-05 23:58 
AnswerRe: Cursors in C# Pin
Andy Moore30-Sep-05 7:52
Andy Moore30-Sep-05 7:52 
Questionlock failed?! Pin
Sangra29-Sep-05 23:55
Sangra29-Sep-05 23:55 
AnswerRe: lock failed?! Pin
Daniel Grunwald30-Sep-05 3:52
Daniel Grunwald30-Sep-05 3:52 
GeneralRe: lock failed?! Pin
Sangra30-Sep-05 4:29
Sangra30-Sep-05 4:29 
Hi,
Thanks it would solve my problem. However, it will always lock the DS object even during readings and what I wanted is to lock the object only during writing. After some search, I came up with a solution, you may take a look at it. I would appreciate your opinion.

if (DS.Tables.Contains(TableName) == true)
{
return DS.Tables[TableName];
}
//Load the table's data
if (Monitor.TryEnter(DS))
{
try
{
using (SqlConnection conn = new SqlConnection(ConnectStr))
{
SqlDataAdapter DA = new SqlDataAdapter(SelectStr, conn);

DA.Fill(DS, TableName );
DA.Dispose();
}
CommonUtils.WriteToSystemLog("Filled table", EventLogEntryType.Information);
}
finally
{
Monitor.Exit(DS);
}
}
else
{
//Another thread is filling the DataSet ->wait
while (DS.Tables.Contains(TableName) == false)
{
}
CommonUtils.WriteToSystemLog("Waited on the table for filling", EventLogEntryType.Information);
}
return DS.Tables[TableName];

BR Sangra
GeneralRe: lock failed?! Pin
Daniel Grunwald30-Sep-05 4:33
Daniel Grunwald30-Sep-05 4:33 
GeneralRe: lock failed?! Pin
Sangra30-Sep-05 4:54
Sangra30-Sep-05 4:54 
QuestionHide Form Pin
spif200129-Sep-05 23:29
spif200129-Sep-05 23:29 
AnswerRe: Hide Form Pin
Gavin Jeffrey30-Sep-05 2:18
Gavin Jeffrey30-Sep-05 2:18 
GeneralRe: Hide Form Pin
spif200130-Sep-05 2:27
spif200130-Sep-05 2:27 
AnswerRe: Hide Form Pin
Robert Rohde30-Sep-05 10:00
Robert Rohde30-Sep-05 10:00 
GeneralRe: Hide Form Pin
spif20012-Oct-05 20:58
spif20012-Oct-05 20:58 
GeneralRe: Hide Form Pin
Robert Rohde4-Oct-05 18:51
Robert Rohde4-Oct-05 18:51 
GeneralRe: Hide Form Pin
spif20014-Oct-05 20:33
spif20014-Oct-05 20:33 
QuestionCrystal Reports Pin
Willem Le Roux29-Sep-05 23:26
Willem Le Roux29-Sep-05 23:26 
AnswerRe: Crystal Reports Pin
Susan Hernandez30-Sep-05 13:14
Susan Hernandez30-Sep-05 13:14 
GeneralRe: Crystal Reports Pin
Willem Le Roux2-Oct-05 23:02
Willem Le Roux2-Oct-05 23:02 
GeneralRe: Crystal Reports Pin
Susan Hernandez3-Oct-05 6:55
Susan Hernandez3-Oct-05 6:55 
GeneralRe: Crystal Reports Pin
Willem Le Roux4-Oct-05 0:03
Willem Le Roux4-Oct-05 0:03 
QuestionGet motherboard serial number Pin
Willem Le Roux29-Sep-05 23:22
Willem Le Roux29-Sep-05 23:22 
AnswerRe: Get motherboard serial number Pin
Dave Kreskowiak30-Sep-05 8:21
mveDave Kreskowiak30-Sep-05 8:21 
GeneralRe: Get motherboard serial number Pin
Willem Le Roux2-Oct-05 23:17
Willem Le Roux2-Oct-05 23:17 

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.