|
.netman wrote: Put your variable in a session
Not recommended until the data you are passing is sensitive. If it is not, a query string validation will do.
|
|
|
|
|
The problem with query string is passing it from page to page
We are not a Code Charity
|
|
|
|
|
If it is handled properly, it's the most efficient and simple method to pass value from page to page.
|
|
|
|
|
hai friends
i want to programatically sort gridview colums
i manually filling the gridview with code
and i have a 3 buttons with text 'column1' , 'column2' , 'column3'
if i click on button 'column1' then gridview should be sorted basing on 'column1'
plz help me...
its urgent ....
thanks in advance
vijay
|
|
|
|
|
|
In asp.net i want to create report other than crystal report because.When i host to sever crystal report is not working. So any other method
|
|
|
|
|
Try Microsoft Report Viewer
http://www.codeproject.com/KB/webforms/ReportViewer.aspx
We are not a Code Charity
|
|
|
|
|
Hi,
I have a XSD having too many element specified. I want to validate my textbox value with a specified element only.
Can anybody suggest me how to do this thing?
Thanks
|
|
|
|
|
Hi
I declared a connection string in my page_load event.
So ive got this:
string connectionString;
SqlConnection con
connectionString = ConfigurationManager.ConnectionStrings[project].ConnectionString;
con = new SqlConnection(connectionString);
Now when I try and reference con.open(); in a different event e.g. onclick it doesnt work.
However when i delclare:
string connectionString2 = ConfigurationManager.ConnectionStrings[project].ConnectionString;
SqlConnection con2 = new SqlConnection(connectionString2);
in the onclick event it works. If you declare in page_load does it not work in a different event?
any help would be great!
cheers
We are not a Code Charity
|
|
|
|
|
i think after postback , it initiates the variable form the scratch
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
So do I need to put the connection string in a postback check as well then?
We are not a Code Charity
|
|
|
|
|
HI,
Please try to put the Connection strings and variables outside the IsPostBack and check. It will work.
Meeram395
|
|
|
|
|
Ive tried that already.
I delcare the name connectionString and con at the top of the page.
I have then specufy connection string code in the page load.:
connectionString = ConfigurationManager.ConnectionStrings[project].ConnectionString;
con = new SqlConnection(connectionString);
However I cannot reference it once outside of the page_load say in an onclick event.
it recognises the con.open(); but doesnt perform the query.
There is no mistake with the query, it works fine.
Ive got the query in a try/catch/finally statement would this affect it?
Thanks for the help, really puzzling me.
We are not a Code Charity
|
|
|
|
|
On the button click event, connection is opening properly or are you getting an error? Put the connection details inside a try/catch block and see what error message you are getting?
Meeram395
|
|
|
|
|
Ive managed to solve it.
I had con.open(); specified more then once throughout my application so I simply deleted all the statements and put just 1 on the page load.
Does any1 know why you can only have one instance of a con.open();?
thanks anyway for the help!
We are not a Code Charity
|
|
|
|
|
If the connection is already open and then again you try to open the connection with the statement con.open, it will end up with error only. if you really want to put the con.open statement everywhere (which is not recommended), you can do like this:
if !(con.ConnectionStatus == Status.open)
con.open();
Regards,
Meeram395
|
|
|
|
|
Thanks, I dont want to put it everywhere just on the page_load.
Thanks for the help though.
We are not a Code Charity
|
|
|
|
|
Hi,
I am working on web applicaiton. I have uploaded the application on server but I want only one person can access the applicaiton at a time. In other words I want only a single instance of my applicaiton running at a time.Remember I am on web applicaiton not window applicaiton.
|
|
|
|
|
If only one person could access it at a time, why would you make it a web application??
I would prefer a win app
May be a singleton approach could work.. never used it thou..
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Please dont re-post as well.
We are not a Code Charity
|
|
|
|
|
Strange. What is the point of web application then ?
|
|
|
|
|
try to use an application variable,
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
You could initiate some sort of logging in your app I guess, but what about timeouts etc?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
There is always only a single instance of the web application running, regardless of the number of users, so what you are asking for would not help you at all.
What you need to do is to have some kind of login so that you can identify the user, and add a limitation in the login so that only one user can be logged in at a time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Do this:
1. Have a table with column named logged
2. When user1 has logged in fill column with value e.g. 1
3. If user2 tries to log in check if there is a value in the column
4. if so dont let user log in
5. When user 1 logs out clear column.
We are not a Code Charity
|
|
|
|