Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Friday, March 30, 2012

increase in CPU usage on lock and unlock of the system

Ours is a windows based application.
When we open the application the CPU usage is 0% and the Memory Usage
is 54,324Kb
When I open a specific form in a module, the CPU usage is 0% and the
Memory Usage increases accordingly (67,730 Kb).
Now when I lock and unlock the System the CPU usage increases to 50%
with the Memory Usage being 67,730 kb.
I have made use of a .Net memory profiler and had taken snapshots
before locking and unlocking the system.
The following is the result after comparing both the versions.
NameSpace Name Total New Removed Delta Total
Max Min Delta
System WeakRefrence 1681 613 0 613 26896
16 16 9808
System.Reflection RunTimeMethodInfo 1229 8
0 8 29496 24 24 192
System.Windows.Forms NativeMethods.TracKMOU.. 10
5 0 5 240 24 24 120
System Runtimetype 2725 4 0 4 4360
16 16 64
System String 37232 5 1 4 2256 102456
18 458
Can anybody let me know the reason for the increase in CPU usage and
how I can overcome this.
And why is there a drastic increase in the number of instances for
WeakReference class when the operation is just locking and unlocking
and nothing to do with the application.
Thanks in advance
sowmyaIs this question related to SQL Server?. If so, please explain what you
mean by locking/unlocking. Perhaps you intended to post to a .Net forum.
--
Hope this helps.
Dan Guzman
SQL Server MVP
<sowmya.rangineni@.gmail.com> wrote in message
news:1182142975.732292.25730@.m36g2000hse.googlegroups.com...
> Ours is a windows based application.
> When we open the application the CPU usage is 0% and the Memory Usage
> is 54,324Kb
> When I open a specific form in a module, the CPU usage is 0% and the
> Memory Usage increases accordingly (67,730 Kb).
>
> Now when I lock and unlock the System the CPU usage increases to 50%
> with the Memory Usage being 67,730 kb.
>
> I have made use of a .Net memory profiler and had taken snapshots
> before locking and unlocking the system.
>
> The following is the result after comparing both the versions.
>
> NameSpace Name Total New Removed Delta Total
> Max Min Delta
> System WeakRefrence 1681 613 0 613 26896
> 16 16 9808
> System.Reflection RunTimeMethodInfo 1229 8
> 0 8 29496 24 24 192
> System.Windows.Forms NativeMethods.TracKMOU.. 10
> 5 0 5 240 24 24 120
> System Runtimetype 2725 4 0 4 4360
> 16 16 64
> System String 37232 5 1 4 2256 102456
> 18 458
>
> Can anybody let me know the reason for the increase in CPU usage and
> how I can overcome this.
>
> And why is there a drastic increase in the number of instances for
> WeakReference class when the operation is just locking and unlocking
> and nothing to do with the application.
> Thanks in advance
> sowmya
>

Friday, March 23, 2012

incorrect syntax near ;

Hi,

I am trying to test a login form and I get this error message and can't find out why. Istarted out with the Login control, but since I have to try it on the ISP's server, I can't use the SQL Server Managment Studio's integrated authentication. So, I converted the login control to a template and assigned a handler for the login button:

protectedvoid LoginButton_Click(object sender,EventArgs e)

{

String usrname = lpLogin.UserName.ToString(); //lpLogin is the <ASP:Login ...>

String conString ="Data Source=mylocalserver\\SQLEXPRESS;Initial Catalog=LPRU;Integrated Security=True";

String selQuery ="SELECT [Password], [FirstName], [LastName] FROM [lpUserInfo] WHERE ([UserID] ='" + usrname +"';";

SqlConnection con =newSqlConnection(conString);

SqlCommand cmd =newSqlCommand(selQuery, con);

con.Open();

SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection); // <--it says "syntax error near ';' " on this line, I tried it without CommandBehavior

while (rdr.Read())

{

Label1.Text= rdr.GetString(0) + rdr.GetString(1); // for testing purposes, trying to print out first name and last name

}

rdr.Close();

con.Close();

}

Is there a way of using SQLServer 2000, used by my ISP, and take advantage of .net 2.0's login control, roles, membership, ...? By just using a connection string?

I think you have an unwanted ";" in the line code

String selQuery ="SELECT [Password], [FirstName], [LastName] FROM [lpUserInfo] WHERE ([UserID] ='" + usrname +"';";

You should change it to this,maybe it can work well.

String selQuery ="SELECT [Password], [FirstName], [LastName] FROM [lpUserInfo] WHERE ([UserID] ='" + usrname;

wish this help you

|||

In the immortal words of Homer Simpson, "DOH!".. (I know your working in C#, but that doesn't mean a semi-colon is good for everythingSmile)

look at your line:

String selQuery ="SELECT [Password], [FirstName], [LastName] FROM [lpUserInfo] WHERE ([UserID] ='" + usrname +"';";

And then look at this line:

String selQuery ="SELECT [Password], [FirstName], [LastName] FROM [lpUserInfo] WHERE ([UserID] ='" + usrname +"')";

Don't you just hate it when that happens... For the record, the queryis executed on the line where you get the exception rather than where you make the assignment.

|||

Jason,

You got rid of the offending semicolon, but you still have to close the single quote and close parenthesis around 'usrname'

|||

NoBullMan:

String selQuery ="SELECT [Password], [FirstName], [LastName] FROM [lpUserInfo] WHERE ([UserID] ='" + usrname +"';";

You missed a ')' at the end of the query string, which you can easily check in Query Analyzer (or any where you can parse T-SQL statement)Smile BTW, if there is a single quote in the usrname, the query string will be broken, unless you replace every single quote in the usrname with 2 single quotes; and such concatenated queries may lead to SQL Injection, so always useParameterized Queries.

|||

Thank you guys. I am from php/MySQL background and the ';' at the end of the query doesn't cause problems in MySQL. I appreciate your help.

|||T-SQL in SQL Server also accepts ';'Smilesql

Monday, March 19, 2012

Incorporating Form Authentication with Report Services

Hi all,

I am new to reporting services in SQL SERVER 2005. I configured my reporting server which is currently runnung when i type //localhost/reportserver in the URL it give me results. Is there anyway of incorporating security in ASP.NET 2.0 using Form Authentication So long as the user clicks on the link having been authenticated he can access the reports on the reporting server. For example I am working on an academic project whereby when user logins, I create a link that him to report server as in

//localhost/reportserver and when user clicks on that link, he can be able to download whatever report he might need.

I am running all these one local machine.

Could someone help me out

Try one of these links. I am beginning to think Russell is the SSRS god.

http://blogs.msdn.com/bimusings/archive/2005/11/29/497848.aspx

http://blogs.msdn.com/bimusings/archive/2005/12/05/500195.aspx

http://blogs.msdn.com/bimusings/archive/2005/09/08/462544.aspx

Ron

Friday, February 24, 2012

Include data in e-mail

I have about 150 people I would like to send e-mail automatically. Each
person would get a unique form letter that includes username and
password I have stored in a SQL table. Is this possible? Help
appreciated. Thanks.
Frank

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Yes. Check out xp_sendmail
in the SQL documentation.

"Frank Py" <fpy@.proactnet.com> wrote in message
news:3fdf82b9$0$196$75868355@.news.frii.net...
> I have about 150 people I would like to send e-mail automatically. Each
> person would get a unique form letter that includes username and
> password I have stored in a SQL table. Is this possible? Help
> appreciated. Thanks.
> Frank
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!