|
last time i checked it does, you also cannot have more than one SqlDataReader per connection.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Yes, but can I close the connection before I read the data in the reader? How exactly does the reader work?
|
|
|
|
|
i dont know exactly how the reader works, but you need to close the reader before you close the connection, unless something has changed, i tried that once a long time ago and got an exception and have not tried it since. If ihad to guess i would think that the reader keeps the result set cached on the dbserver somwhere and uses the connection to go get whatever you tell it to go get, i think odbc works ina similar fashion, i could be and probably am wrong about some things but i have not looked into the specifics of how in a while, and when i did it was for .net 1.1 not the newer versions.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Aptiva Dave wrote: does the sql connection need to stay open while you are reading from the sqldatareader?
Yes.
The data reader doesn't contain the result from the database, it only reads one or a few records at a time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
you might be using the datareader which fetches the data in loop.
|
|
|
|
|
I'm using a treeview control.
The treeview is on a masterpage, right beside it it has the container.
The user uses the treeview to navigate to aspx pages using this masterpage.
But on each page load the treeview nodes are collapsed to original state.
I want to maintain the nodes expanded state.
How can I do that?
modified on Tuesday, November 11, 2008 1:49 PM
|
|
|
|
|
hi
i think that you configured the TreeView contorl's ViewState property to false.
you can change it to true.
bye.
Mohammad Khansari
|
|
|
|
|
I just want to maintain the treeview depth between requesting pages and not to go back to the expandDepth specified in TreeView property window.
|
|
|
|
|
hi
if you configured treeview's viewstate property to false then treeview state back to it's default through requests.
so you should change the viewstate property to true then you can maintain treeview state through requests.
if you meant anything else tell me my dear.
bye.
Mohammad Khansari
|
|
|
|
|
The TreeView state is True.
but how can I maintain the ExpandDepht?
I want to keep the ExpandDepth not to back to its original state after each request.
Thanks,
|
|
|
|
|
Some pages on my site have sensitive information. If the user is on one of these pages how can I have the page redirect to the login page if there is no interaction on it, say five minutes.
|
|
|
|
|
Take a look at this article.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
You can use SesionTimeout but it will be applicable on whole site.just for few pages,you can use a timer to achieve this
Cheers!!
Brij
|
|
|
|
|
When you are login just make the cokie for user and set expiration time of the cookie say five minut and on that sensitive pages u just check the cookie on the page load event if the user came at that page after five minut then the cookie will expire and redirect to login page.
|
|
|
|
|
When a user successfully logs into my website he is sent to the main page. From there if he clicks on the logout link on that page he goes back to the login page. When he is directed back, however, the browser uses the page in the cache. How can I tell it to reload the login page from the server instead?
|
|
|
|
|
This article should help.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
when the user click on the logout button then it is redirected to the logout page where in page load event their is the code for delete the cookie and redorect to login page.
|
|
|
|
|
Hi all,
I have one textbox,called Name which is validated for not blank.
Error msg: txtbox not blank.
if click the submit button,the validation applies and eerrror msg. displays --txtbox not blank.
and the cursor is out from the textbox.
my problem is ,after i got the error msg. the cursor will be placed in the textbox name.
i am using
txtname.Focus() but still it is not working.
If txtname.Text.Trim.Equals("") Then
lblError.Text = "Please enter Name."
lblError.Visible = True
txtname.Focus()
Exit Sub
End If
Thanks in advacce
mahaboobs
|
|
|
|
|
...
Blog link to be reinstated at a later date.
|
|
|
|
|
Hi guys ,
i like to insert some text area in to my database table...,
That text area should be like our codeproject text area...,
mean i need in that text area should look like rich textbox..,
and those datas have to store in my table...,
when i am display the data how the datas has been entered similar;ly it have to display...,
mean if i said some place bold it have to display that text have to bold...,
plz give me regarding this..,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Could not load file or assembly 'Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies
I am getting this error.. Please give the solution for it. When i run my application i am not able access any page.
|
|
|
|
|
Is MS Word installed on your server?
|
|
|
|
|
Hello dear,
I am in big trouble. I want to export a asp table to excel with all formating, I am unable to get that I am setting the width in html table but exported table in excel does not contain that width it has its own width according to text. Cant i set the width of cell as of table?
any help would be highly appreciated.
Thanks
Rohit
|
|
|
|
|
Hy,
how can i find the age of a person in dd/mm/yyyy format.....if the date of birth is given..
i have written a code but it doesent find the number of days(whn the current date is less than the date of birth ex 7/11/2008 - 12/10/2008 )
my code is
string m_Str = TextBox1.Text;
int m_Y1 = DateTime.Parse(m_Str).Year;
int m_m1 = DateTime.Parse(m_Str).Month;
int m_d1 = DateTime.Parse(m_Str).Day;
int m_Y2 = DateTime.Now.Year;
int m_m2 = DateTime.Now.Month;
int m_d2 = DateTime.Now.Day;
int m_date = m_d2 - m_d1;
if (m_date < 0)
{
m_m2 = m_m2 - 1;
?????
}
int m_month = m_m2 - m_m1;
if (m_month < 0)
{
m_Y2 = m_Y2 - 1;
m_m2 = m_m2 + 12;
m_month = m_m2 - m_m1;
|
|
|
|
|
Sorry, what?
You're having trouble finding someone's age when their date of birth is in the future...?
And what's wrong with this:
System.DateTime birthDate = DateTime.Parse(m_Str);
System.TimeSpan diffResult = DateTime.Now.Subtract(birthDate);
Console.WriteLine("Difference in days = " + diffResult.Days);
|
|
|
|