| | |
how to close a DR and then open it again for use
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2007
Posts: 35
Reputation:
Solved Threads: 0
Hi all ,
i m using Ms-Access applicaion in c# bt getting error while using a datareader again after closing it.
here is the code.
can any one please help me??????????
if (sCl.Read())
{
if (!(sCl.GetValue(0) is DBNull)) code = sCl.GetInt32(0);
if (!(sCl.GetValue(1) is DBNull)) court = sCl.GetInt32(1);
if (!(sCl.GetValue(3) is DBNull)) party1 = sCl.GetInt32(3);
if (!(sCl.GetValue(4) is DBNull)) party2 = sCl.GetInt32(4);
url = "f:\\manju\\cl\\clsupr\\" + code + ".htm";
webProcFile.Navigate(url);
webProcFile.Show();
get.Connection = src;
get.CommandText = "select Code,Court from caselaw where ( Court > " + code1 + " AND Court < 21 AND ((Party1=" + party1 + " AND Party2=" + party2 + ") OR (Party1=" + party2 + " AND Party2=" + party1 + ")))";
if (stat.HasRows) stat.Close();
stat = get.ExecuteReader();
}
else
sCl.Close();
}
it is showing error in stat = get.ExecuteReader();
please help e in solving this problem.
Thanx in advance.
i m using Ms-Access applicaion in c# bt getting error while using a datareader again after closing it.
here is the code.
can any one please help me??????????
if (sCl.Read())
{
if (!(sCl.GetValue(0) is DBNull)) code = sCl.GetInt32(0);
if (!(sCl.GetValue(1) is DBNull)) court = sCl.GetInt32(1);
if (!(sCl.GetValue(3) is DBNull)) party1 = sCl.GetInt32(3);
if (!(sCl.GetValue(4) is DBNull)) party2 = sCl.GetInt32(4);
url = "f:\\manju\\cl\\clsupr\\" + code + ".htm";
webProcFile.Navigate(url);
webProcFile.Show();
get.Connection = src;
get.CommandText = "select Code,Court from caselaw where ( Court > " + code1 + " AND Court < 21 AND ((Party1=" + party1 + " AND Party2=" + party2 + ") OR (Party1=" + party2 + " AND Party2=" + party1 + ")))";
if (stat.HasRows) stat.Close();
stat = get.ExecuteReader();
}
else
sCl.Close();
}
it is showing error in stat = get.ExecuteReader();
please help e in solving this problem.
Thanx in advance.
![]() |
Similar Threads
- Close all active mssql server connections from vb.net (VB.NET)
- I can't open IE (Viruses, Spyware and other Nasties)
- Spyware? hijacked cursor at "2:Open" sign (Viruses, Spyware and other Nasties)
- Internet Explorer does not open additional window (Viruses, Spyware and other Nasties)
- Every time I open Internet Explorer (Viruses, Spyware and other Nasties)
- Internet explorer will not close (Web Browsers)
- Webpages don't always open (Web Browsers)
Other Threads in the C# Forum
- Previous Thread: how to use hexadecimal value to obtain the character value in c#
- Next Thread: Reading .dat file data into an array
| Thread Tools | Search this Thread |
.net access algorithm angle array barchart bitmap box broadcast buttons c# capturing check checkbox client combobox control conversion convert csharp custom database datagrid datagridview dataset datetime dbconnection degrees delegate development disappear draganddrop drawing encryption enum event excel file firefox form format forms function gdi+ httpwebrequest image index input install java label leak libraries list listbox mandelbrot math monodevelop mouseclick msword mysql operator path pause photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox round server sleep socket sql statistics stream string table tcpclientchannel text textbox thread time timer update usercontrol validation virtualization visualbasic visualstudio webbrowser windows winforms wpf xml





