|
You are welcome,
Was it helpful?
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Hi..
I know how to use the application and session state variables and i have used the following code :
(In the Global.asax
protected static int m_ActiveUsers;
public static int ActiveUsers
{
get
{ return m_ActiveUsers;
}
}
protected void Application_Start(Object sender, EventArgs e)
{
Application.Lock();
m_ActiveUsers=0;
Application.UnLock();
}
protected void Session_Start(Object sender, EventArgs e)
{
Application.Lock();
++m_ActiveUsers;
Application.UnLock();
}
protected void Session_End(Object sender, EventArgs e)
{
Application.Lock();
--m_ActiveUsers;
Application.UnLock();
}
But the problem it doesnt give me the right number always.Some times this code tells me there is two visitors while there is no one except me.And some times it doesnt decrement the visitors count number when i exit.
Do any one know how to make a better way that wont be affected by application errors and will solve my problem?
"I am too late but i will never give up"
|
|
|
|
|
In global file
at application start
application("users") = 0
at form loads
Application("users") = CType(Application("users") , integer) + 1
label1.text = Application("users").tostring
|
|
|
|
|
Your code will count how many times users load the webform not how many users visit the website?!
"I am too late but i will never give up"
|
|
|
|
|
this is code is not right .
suppose currently 4 user are active and one of 4 user quit and again he comes back for him session will start form begining and session_start function calculate m_active user to 1 so it will give wrong result.
better is that maintain this variable m_active user in some file or database and increment and decrement it when user starts and end session.
hope this will work
Murtaza Tahir Ali Dhari
|
|
|
|
|
Thank you for your respond...
You said :and session_start function calculate m_active user to 1
As i know when a user quits and returns this will not restart the whole web application(Application_End) but will restart only one of the four users sessions(Session_End).I mean ending one session will not end other 3 sessions.
"I am too late but i will never give up"
|
|
|
|
|
Sir,
Can I rename the file programically in vb.net? If yes Please help me
Thanks and Regards
Amaneet Brar
|
|
|
|
|
Hi
I have a dropdown list with all the hub groups. When a hub group is selected, it loads and displays all the hubs for that hub group.
In my apsx code I have defined an empty table as follows:
<asp:Table id="tblHubCommRates" BorderWidth="0" Width="100%" runat="server">
</asp:Table>
When the hubs are loaded, I dynamically create the row, the cell, and the textbox. The textbox is called txtHub1, or txtHub7, depending on the hub ID from the database. The can be many hub for a selected hub group. Thus, many rows and may text boxes.
I would like to iterate through these dynamically generated textboxes to get there names, and the values in the textboxes.
When I do the following iteration (on 2 textboxes that were created):
foreach (Control c in this.tblHubCommRates.Controls)
{
Response.Write(c.GetType().ToString() + "<br>");
}
...it prints
System.Web.UI.WebControls.TableRow
System.Web.UI.WebControls.TableRow
I'm assuming the parent control is the table row's cell. But how do get the value of the textboxes in the cells?? Please can someone advise??
Regards,
ma se
|
|
|
|
|
I don't know why you are doing it this way instead of using a datarepeter or gridview but...
The table has a collection of TableRows, the TableRow has a collection of tableCells the TableCell has the textbox.
Try something like this...
private void TextboxValues(System.Web.UI.Control cntrl)
{
if (cntrl.GetType() = typeof(TextBox))
{
TextBox t = (TextBox)cntrl;
Response.Write(t.Text);
}
if (cntrl.HasControls)
{
TextboxValues(cntrl);
}
}
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
How do Iterate through these rows that I have created, then to iterate through the cells that I have created.. Then only do I think you above method should work.
|
|
|
|
|
Hello all,
I Need to Implement Free Text Search for my Application using ASP.NET 2.0. Can anyone give me article or proceedure for this.
awaiting for response
regards
GV Ramana
|
|
|
|
|
how to convert sql database into xml form in asp.net + c#.
Please give me some links.
Thanks in advance .
|
|
|
|
|
Hi,
You could use this stored procedure to convert the SQL Tables into xml
sp_makewebtask
You can have a look at this procedure from SQL books online.
Also you can export the contents of datatable using the code.
First you have to create a typed dataset, and then you fill the contents to the datatable in the dataset and then use the method
dataset.writexml to fullfill your requirement
Hope i have helped you out,
Happy Programming
|
|
|
|
|
Sir,
I am using bitmap class to check the dimensions of the file I mean height and width.
Dim bm as new bitmap(filepath)<br />
bm.height<br />
bm.width<br />
Now the problem is bitmap class is not picking the jgg files and some other image files .Can you please tell me another way by which the dimensions of any type of image file can be find out.
-- modified at 8:42 Wednesday 14th June, 2006
|
|
|
|
|
I get an error message "Computer name could not be obtained, run time error" when i try to access the web application from any pc in the network except my pc where my web application reside and i changed the destination of the database to server and the application stay in my pc and i also can submit data to the server from my pc only.
all people working in the network can access the web site but when it comes to sending data the error comes.
and the error might be related to sqlconnection connection string object setting but i tried hardly and for a very long time with no result.
I appreciate any help.
thanks
wael Inaim.
|
|
|
|
|
hi
right click on u r physical folder - go to security tab - click on add - in that dialog box select Location as ur PC Name, Enter the object name as 'aspnet' and give full access, also add 'Everyone' as object name and give full access permissions.
regards
GV Ramana
|
|
|
|
|
hello, actually i am using windows xp as the operating system to host and the problem when i change anything from the setting things get worse, i do not know now why i have a security error and they say check the configration file even though i am running the application from my computer , i can not enter data. and what made me very angry and sad is it's a techniqal type of problem that is not relating to programming, and no body support in this stupid company that i am working in, cause i am almost the only programmer.
by the way which configration file , it mean
wael Inaim.
|
|
|
|
|
again, the same stupid error occured, I become sure that there is no solution to this error , i tried your way of the sharing but also did not change anything. thanks for your help and i am waiting more and more ideas.
wael Inaim.
|
|
|
|
|
Hi
I am having difficulty with a Web Application that does not seem to close or release a Sql Server database connection. I am using Visual Studio 2003 and SQL Server 2000.
I am using the following data access method:
public static void LoadData(string connectionString, string procedure)
{
SqlDataReader reader = null;
SqlConnection conn = null;
try
{
conn = new SqlConnection(connectionString);
conn.Open();
SqlCommand sqlCmd = new SqlCommand(procedure, conn);
sqlCmd.CommandType = CommandType.StoredProcedure;
reader = sqlCmd.ExecuteReader();
while (reader.Read())
{
}
}
catch (Exception e)
{
throw e;
}
finally
{
if (reader != null)
{
reader.Close();
}
if (conn != null)
{
conn.Close();
conn.Dispose();
}
}
}
After I have run my Web App and closed it, I went to Query Analyzer and tried to drop the database (the database only has one table and I am just using it to test). It gives me the following message:
Cannot drop the database 'TestDatabase' because it is currently in use.
When I try the same data access method in a Windows App and try to drop the database afterwards it drops with no problem. So it seems to me that there must be something extra that I have to do to ensure that a Web App releases or closes the database connection.
Any ideas?
Thanks
Kobus
-- modified at 8:43 Wednesday 14th June, 2006
|
|
|
|
|
Make the class as IDisposable and call the despose method to close connection
public class MyDB : IDisposable {<br />
public void Dispose() {<br />
Conn.Close();<br />
}<br />
}
Hope this will work
Nav.
|
|
|
|
|
In the finally block, after closing the connection do not call Dispose . Close and Dispose have the same effect. Calling dispose after calling close will create a new connection and try to close it. If you remove the conn.Dispose(); line everything should work fine.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Hi,
I need to instal the .NET 2.0 framework on the test machine to test the asp.net 2.0 project that I have developed.
Where do I download the .NET 2.0 framework from please?
I went to this site but can not see where to download.
http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en
Thanks
|
|
|
|
|
Have you tried going through windows update?
|
|
|
|
|
|
I am working on a small project in asp.net,I saved a file in a folder in the project and i saved the path of the file in the database,now i want to download the file saved in the folder through the path saved in database can please somebody send me the code for this
thanking you
Amar
|
|
|
|