|
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
|
|
|
|
|
Isn't this the same thing as your post 'single instance of an application using Application start in global.asax.'?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
Use
if (Page.IsPostBack == true)
{
}
We are not a Code Charity
|
|
|
|
|
i am using Ajax 2.0 UpdatePanel. When first time page is load, focus is set properly but after postback code for focus run properly but focus is not set. This is because of updatepanel but i cannot find its solution.
Thankx.
Regards Syed Kamran ul Haq
ALLAH HAFIZ
|
|
|
|
|
Hi,
Can any one suggest me how to maitain a single instace of an application using Application start method of Global.asax.
|
|
|
|
|
|
i have a window from where i ll get the list of records in a pop up window. on selecting a record i have to display the records in a previous window.
the way i am able to do is displayin the data in new window.
|
|
|
|
|
OK so you've basically got a base page and then a pop-up window where you can choose an option and then the window closes and you go back to your base page. You are going to need to re-fresh your base page when you go back to it. Just put any important values in a session.
Does this help so faR?
We are not a Code Charity
|
|
|
|
|
thx..
ill try this
|
|
|
|
|
I have a web page with text written in a special font (that dosen't exist by default in the windows/fonts dir).
So, is there any way to install this font on the user m/c without forcing the user to manually put this font in the fonts dir?
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!
|
|
|
|
|
I think the only way they could do it is to download it from your app.
The problem is, is that there are so many fonts to choose from that asking the user to install another is not great for your app.
I would recommend using one of the exisitng fonts
We are not a Code Charity
|
|
|
|
|
i am dowloading it form my application , but not being saved to the user machine
here is the code.
StringBuilder sb = new StringBuilder();<br />
SHGetFolderPath(IntPtr.Zero, 0x0014, IntPtr.Zero, 0x0000, sb);
if (Directory.Exists(sb.ToString()))<br />
{ <br />
DirectoryInfo f = new DirectoryInfo(Server.MapPath("fonts")); <br />
foreach (FileInfo fil in f.GetFiles())<br />
{<br />
if (!File.Exists(sb.ToString() + "\\" + fil.Name.ToString()))<br />
{<br />
fil.CopyTo(sb.ToString() + "\\" + fil.Name.ToString(), true);<br />
}<br />
else<br />
{<br />
Response.Write(sb.ToString() + "\\" + fil.Name.ToString());<br />
}<br />
}<br />
}
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!
|
|
|
|
|
Pankaj Garg wrote: but not being saved to the user machine
you are totally lost. Please take a beginner book and learn ASP.NET. ASP.NET runs on server and it can't access users machine.
|
|
|
|