Click here to Skip to main content
15,906,645 members
Home / Discussions / C#
   

C#

 
GeneralRe: Page_Unload question Pin
Sled Dog30-Sep-05 4:56
Sled Dog30-Sep-05 4:56 
QuestionCrystalReport RAS Request Pin
User 209307330-Sep-05 2:26
User 209307330-Sep-05 2:26 
Questionfetching data from dataset using sql query Pin
arusmemon30-Sep-05 1:40
arusmemon30-Sep-05 1:40 
AnswerRe: fetching data from dataset using sql query Pin
Gavin Jeffrey30-Sep-05 2:07
Gavin Jeffrey30-Sep-05 2:07 
AnswerRe: fetching data from dataset using sql query Pin
Jon Rista30-Sep-05 7:36
Jon Rista30-Sep-05 7:36 
QuestionRotating images Pin
PHDENG8130-Sep-05 1:25
PHDENG8130-Sep-05 1:25 
AnswerRe: Rotating images Pin
Robert Rohde30-Sep-05 9:55
Robert Rohde30-Sep-05 9:55 
Questionhow to pass messages between java and .net without using sockets Pin
hasansheik30-Sep-05 1:03
hasansheik30-Sep-05 1:03 
AnswerRe: how to pass messages between java and .net without using sockets Pin
mohamad rafi30-Sep-05 3:01
sussmohamad rafi30-Sep-05 3:01 
AnswerRe: how to pass messages between java and .net without using sockets Pin
Daniel Grunwald30-Sep-05 3:32
Daniel Grunwald30-Sep-05 3:32 
AnswerRe: how to pass messages between java and .net without using sockets Pin
Jon Rista1-Oct-05 8:18
Jon Rista1-Oct-05 8:18 
QuestionAxAcroPDFLib???? Pin
Walt12330-Sep-05 0:20
Walt12330-Sep-05 0:20 
AnswerRe: AxAcroPDFLib???? Pin
Dave Kreskowiak30-Sep-05 8:23
mveDave Kreskowiak30-Sep-05 8:23 
GeneralRe: AxAcroPDFLib???? Pin
Walt12330-Sep-05 15:57
Walt12330-Sep-05 15:57 
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 

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.