|
Davids_Maguire wrote: i'm afraid that this static class and the queue member may be removed form memorey and then loosing this data ..
Yes, you should be afraid.
The static variable will remain intact as long as the web application is running on the server, but the server may shut down the application any time it feels like it. In that case, the next call to the web service will be starting a new instance of the application, and the static variable will be empty.
---
b { font-weight: normal; }
|
|
|
|
|
thanks so much for help ..
but you said
"The static variable will remain intact as long as the web application is running"
i don't think you mean the web application that calls the WebService
but the static variable will remain in memory as long as the server that hosts web service not the - web application -is running .. right ??
and thanks again
|
|
|
|
|
Right. The web application I was talking about was of course the application where the static variable is. You didn't even mention that it was another web application that was using the web service.
---
b { font-weight: normal; }
|
|
|
|
|
i want create templet coulmn in my datagrid with programing and dynamically.
and i want put a dropdownlist in edititem templet and put a label in item templet in each column. how can do this work
-- modified at 7:01 Sunday 26th November, 2006
|
|
|
|
|
Dear all
i was wondering what regular expression should i use for a 1-6 digits number (0 - 999999)
Thanx in advance
Best Regards
3ala2
|
|
|
|
|
\d{1,6}, I believe.
You should search for and download a program called Expresso for building regex.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
thank u very much
u were very helpful
i found that software and i'll start using it
Best Regards
3ala2
|
|
|
|
|
I am having an application with one text box and one button.
On click on the button it should be clicked state (like switch on / off).
Can any one help on this topic?
kamalnath
|
|
|
|
|
There is no property for the button called state
but u can do teh workaround by declaring a glabal boolean variable "bFlag" and set it to False. Add a text box called txtState
<br />
Dim bFlag As Boolean = False 'False for unclicked and True for clicked<br />
on the button_click event u do the following
<br />
Call checkButton()<br />
<br />
private sub checkButton()<br />
if (bFlag) Then<br />
txtState.Text = "Clicked"<br />
Else<br />
txtState.Text = "Unclicked"<br />
End If<br />
bFlag = Not bFlag<br />
End Sub<br />
u can set the Text property for the textbox as "Unclicked" for teh first time teh page opens
Hope this would help
Best Regards
3ala2
|
|
|
|
|
Unlike Windows XP Home Edition, you can install (enable) IIS on Windows XP Media Center Edition. My question is, is there any (hard-coded) restriction on the number of connections? Another question is, what is the difference between XP Media Center and XP Professional?
Thanks.
|
|
|
|
|
How much expensive openning and closing connection is when connection pool is used ???
Assume I invoke four stored procedures in a page , I open and close the connection for invoking each . How much will it affect the performance of that page ??
calling this in a page :
<br />
Connection.Open();<br />
Connection.Close();<br />
<br />
Connection.Open();<br />
Connection.Close();<br />
<br />
Connection.Open();<br />
Connection.Close();<br />
<br />
Connection.Open();<br />
Connection.Close();<br />
Is it worth replacing it with this. I have made the site like above.It is so hard for me to replace that. What is your suggestion ?
<br />
Connection.Open();<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Connection.Close();<br />
|
|
|
|
|
When Connection Pooling is enabled, connections aren't opened and closed as such, rather a whole bunch are opened all at once and then left open. When you get a connection from the pool you are retrieving a already open connection, and when you close the connection you are simply returning that connection back to the pool but in a left open state. Or so I believe.
Thats means in theory there would be no difference between the two implementations you've shown, however you could always test the performance by measuring the execution speed of the page for the two implementations, and see if there's any difference.
However, good practices dictate that you should only hold onto connection objects for as short a time as possible, as even with connection pooling, retrieving the connection from the pool means that other processes or clients can't use it. So the first practice would probably be the best approach, but if your entire site is done using the second practice, I wouldn't loose sleep over it
Connection pooling is automatic provided you meet the following conditions, the connection string must remain exactly the same (even adding spaces to the string will effect connection pooling, so make sure you have the string stored inside the web.config file, or in some external source, and not hard coded into the class. Also only certain vendors support it I believe, you're using Sql Server with SqlConnection class?
EDIT: Sorry misread your post you implemented the first practice which is good (opening and closing connections as needed for each Stored Procedure). If you're calling all four Stored Procedures immediately one after the other, then you could probably use the second practive of holding onto one connection object.
-- modified at 11:23 Sunday 26th November, 2006
|
|
|
|
|
You said
so make sure you have the string stored inside the web.config file, or in some external source, and not hard coded into the class.
Thank you very much for your help. What is wrong with hard coding the connection string in the class ??? I have defined it in my base business class. Why it affects connection pooling ??
|
|
|
|
|
Easier deployment, if you have to change the connection string for when the web application gets deployed, it's easier to edit an xml file as oppose to edit a class file then recompile it etc.
As for Connection Pooling, as long as you have the connection string defined in one place its fine. If you have the same connection string defined in multiple classes in one class you might write...
"Data Source=localhost;Initial Catalog=databaseName;....."
Whereas in another class you write...
"Data Source=localhost; Initial Catalog=databaseName;....."
Notice the space between localhost; and Initial. Because the strings are different it will clause connection pool to be reset, or use a different pool. Defining the string in one place (such as your business base class) avoids these potential typos.
|
|
|
|
|
Thank you for help. I saw your site ,how do u find execution time of your page ?? sounds intresting . Explain to me please if your like .
|
|
|
|
|
In your code behind file (or wherever you put code)....
private int startTime;<br />
<br />
protected void Page_Init(object sender, EventArgs e)<br />
{<br />
startTime = Environment.TickCount;<br />
}<br />
<br />
protected void Page_PreRender(object sender, EventArgs e)<br />
{<br />
int endTime = Environment.TickCount;<br />
<br />
double executionTimeInSeconds = (double)(endTime - startTime) / 1000.0;<br />
<br />
SomeLabelInYourPageSomewhere.Text = executionTimeInSeconds.ToString();<br />
}
Basically you start the timer early in the page event cycle (the Page_Init) and stop the timer late in the cycle (Page_PreRender) which captures the page execution time for almost everything in between (Page_Onload, Control Initialisation, Data bindind, Events from client side button presses etc.).
|
|
|
|
|
|
Hi All,
I don't know in which message board I've to rise this question.. Please help me..
I've Developed a Asp.net shopping cart web application with vb.net as code behind.. SQL server as Back end..
I am in need of delete the records of the particular table at every day midnight and i want to have the blank table in next morning..
Is it possible to do?? Please help me in this issue
Thanks in Advance
|
|
|
|
|
maybe u should look for triggers based on time
Best Regards
3ala2
|
|
|
|
|
The best option is to define a JOB in sql servere and schedual it accordingly.You will find plenty of articles through google to do so.
|
|
|
|
|
Hi and thanks for attending at my message.
In the project I'm currently working, users need to capture a lot of information in a site, so I thought I could build a Web Service to do this. I was thinking in make that the web service pass the controls that are need, because the information they're gonna be capturing it can be very diferent between one form and another, so I want to avoid codding a lot of diferents webforms.
I thought that I could build a Web Service that can command a page to show o not some of the controls on the site, so the user just got to select the form and presto! they got the all the controls they need to capture the information.
But then I remembered: I can only pass data through the web service. The curiosity is really big...does anyone knows a way to pass controls through web services? can anyone tell me of another way to show diferents kind of controls for capturing data besides show/hide panel? or even another approach to solve this kind of thing?
Any suggestions or advices will be great!!!
Thanks every body!!!
A Programmer is as many times Programmer as Lenguages knows
|
|
|
|
|
Hi,
If you are planning to have dynamic controls ,You will have some Algo in your mind to store this data as well.
If you'r clear with that then you will have to create the controls dynamically on the basis of controls collection returns from your webservice .Then once user inputs data and submits form you will have to read these controls back.
donno wether i am able to make myself clear.....
Regards
|
|
|
|
|
I was thinking in something just like you were saying, send a collection of controls and then get them back and iterate through them, but I don't think it's a good idea anymore, because of the codding I'll have to do for all the arrangement of controls.
Now I'm thinking to do something diferent, I like the idea of a web service that only recive a customized object, even when I still have some problems passing those thing of object to a web service. I've done some googling and I decide to work with multiview/view controls, it seams pretty easy.
So, now I'm asking for direction on doing that: pass a cutomize object to a web service.
If you payback knows something about that it'll be great!!
Thanks again.
The limits of my language are the limits of my mind
|
|
|
|
|
I want to send an email using asp.net .. the main problem is that i dont know which smtp i must use? i want to run this on the server. I am using the smtp.mail.yahoo.com but its not working.
The Code:
Dim objEmail As New MailMessage<br />
objEmail.To = "buyproductsmalta@yahoo.com"<br />
objEmail.From = txtEmail.Text<br />
objEmail.Subject = "Query: " & "From " & txtName.Text & " " & txtSurname.Text<br />
objEmail.Body = txtQuestions.Text<br />
objEmail.Priority = MailPriority.High<br />
SmtpMail.SmtpServer = "localhost"<br />
<br />
Try<br />
SmtpMail.Send(objEmail)<br />
lblSent.Visible = True<br />
lblSent.Text = "The query has been sent...."<br />
Catch exc As Exception<br />
lblSent.Visible = True<br />
lblSent.Text = "Not Sent .. Please try Again"<br />
End Try
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Does you mail server (smtp.mail.yahoo.com) require authentication, eg. username and password? If so you'll need to set that, also could you provide the error message that the exception is throwing...
Catch exc As Exception
lblSent.Visible = True
lblSent.Text = "Exception was: " & exec.Message
End Try
|
|
|
|