|
Am sorry .it was meant to be an answer but posted in the inocrrect forum.Wss in a hurry.Sorry
|
|
|
|
|
------------
--------------
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlObj = new SqlConnection();
sqlObj .ConnectionString = System.Configuration.ConfigurationManager.AppSettings["connectionStrings"].ToString();
SqlCommand sqlCmdObj = new SqlCommand();
sqlCmdObj.Connection = sqlObj;
//We have a command and connection object -this data adapter is the interface for the two
SqlDataAdapter sqlAdapterObj = new SqlDataAdapter();
sqlAdapterObj.SelectCommand = sqlCmdObj;
DataSet dSetObj = new DataSet();
sqlCmdObj.CommandText = "selQry";
sqlCmdObj.CommandType = CommandType.StoredProcedure;
sqlAdapterObj.Fill(dSetObj);
GridView1.DataSource = dSetObj.Tables[0];
GridView1.DataBind();
}
protected void btnEnter_Click(object sender, EventArgs e)
{
SqlConnection sqlObj = new SqlConnection();
sqlObj.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["connectionStrings"].ToString();
SqlCommand sqlCmdObj = new SqlCommand();
sqlCmdObj.Connection = sqlObj;
sqlObj.Open();
sqlCmdObj.CommandText = "insQry";
sqlCmdObj.CommandType = CommandType.StoredProcedure;
if (txtName.Text != ""&& txtAddress.Text!="")
{
sqlCmdObj.Parameters.AddWithValue("@txtname", txtName.Text);
sqlCmdObj.Parameters.AddWithValue("@txtAddress", txtAddress.Text);
sqlCmdObj.ExecuteNonQuery();
}
else
return;
}
protected void txtDelete_Click(object sender, EventArgs e)
{
SqlConnection sqlObj = new SqlConnection();
sqlObj.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["connectionStrings"].ToString();
SqlCommand sqlCmdObj = new SqlCommand();
sqlCmdObj.Connection = sqlObj;
sqlObj.Open();
sqlCmdObj.CommandText = "delQry";
sqlCmdObj.CommandType = CommandType.StoredProcedure;
sqlCmdObj.Parameters.AddWithValue("@txtname", txtName.Text);
sqlCmdObj.Parameters.AddWithValue("@txtAddress", txtAddress.Text);
sqlCmdObj.ExecuteNonQuery();
}
protected void txtName_TextChanged(object sender, EventArgs e)
{
}
}
|
|
|
|
|
Hello All:
How can I take the return value of a message box(i.e if I press on cancel button it'll exit) or anything else .....
Thanks a lot
|
|
|
|
|
DialogResult result = MessageBox.Show("Yes or no", MessageBoxButtons.YesNo);
if(result == DialogResult.Yes)
...
else
...
I love the DialogResult class personally. You can use it on custom dialogs (forms with buttons resembling dialog results).
It's a good way to pass data between forms.
|
|
|
|
|
|
The big empty sig is REALLY annoying, BTW
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Maybe he's an artist trying to make a statement?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
The DialogResult type will be returned and it will tell you which buttons were clicked.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
In a uercontrol i have in a c# application, it requires vertical scrollbars. That part works fine..but there is an annoying and limiting part of it that i'd like to fix.
When you scroll...lets say in Internet explorer..when you click on the scrollbar, move up and down, it is always changing the visible area (virtual space) of the webpage.
In my application's user control i click down on the scrollbar, move it up and down, release on the scrollbar and then it updates the visiblearea. Note that the visible area doesn't change at all until you release.
How can i get the feature of constant updateing of a controls visible area?
|
|
|
|
|
Hi,
you can add a handler to the Scroll event, and have it Invalidate() the Control,
causing a repaint based on the current scroll value.
|
|
|
|
|
Thanks for the reply, but unfortunately that does not work. I think the scroll event is only called after the user releases the scroll bar(some eventargs values are newvalue, oldvalue).
Would i have to track the click?-
(scrolling == true)
and mouse move-
if(scrolling == true)....
|
|
|
|
|
Scroll event works fine for me.
There also is an alternative with ValueChanged event (works when scrolling or setting
a new value).
|
|
|
|
|
Ok lets figure this out...
I have a user control with these properties
autoscale = true;
autosize = false;
Scroll event handler:
void SplitinfoScroll(object sender, ScrollEventArgs e)<br />
{<br />
this.Invalidate();<br />
}
i've also tried Invalidate(this.bounds);....
what am i doing wrong?
How did you set it up?
|
|
|
|
|
I have used live scroll bars many times, never had any problems with them.
Did you wire the event? (not shown)
Does it fire at all?
What is this in this.Invalidate? is it the control that needs being redrawn?
Use logging or interactive debugging to debug!!
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
yeh i need the control to change it's displayed area / virtual space.
here is the event caller(i do fire the event):
this.Scroll += new System.Windows.Forms.ScrollEventHandler(this.SplitinfoScroll);
-am i calling the right ScrollEvent?
the scrollbar is just one that automatically appears when the control's displayed area cannot display all of it's contents.
i used a MessageBox.Show("scrolling") debugging and it did get called whenever the scrollbar moved.
the controls display area needs to be redrawn.
|
|
|
|
|
Maybe this is one of those rare occasions where one should use Refresh() instead of
Invalidate().
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
..noo.. i've also tried this.Update();
would you like me to send you the project?
you can look at it here:http://digitalhockey.svn.sourceforge.net/viewvc/digitalhockey/[^]
...woah i think i entered it right...i got some ahref stuff..
anyways try Digital Hockey.exe in bin->debug and create a team..open it..look at the buttom right.
or look at the files it would be in usercontrols->splitinfo.
ty.
|
|
|
|
|
Hi,
what I would like to do is to show in a message box text selected in email body. Is there a method to obtain what I select in outlook mail body?
Thanks
modified on Sunday, January 13, 2008 11:11:48 AM
|
|
|
|
|
Not sure off the top of my head at the moment, but you may want to look around at the Windows API for anything that grabs the currently selected text.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
well....if the email body is in a textbox ( i don't use outlook) you could probably use something like
MessageBox.Show(emailbodytxtbox.SelectedText);
also look into this area(may need to add a reference)
System.Net.Mail.SmtpClient
|
|
|
|
|
Hello,
Is it possible any way to override the Hosting Page's RENDER Method from a server control in ASP.NET C#.NEt 2.0 ? I am developing a server control and my intention is to modify the whole page's rendering HTML from this Control.
Please advice.
Thank you,
|
|
|
|
|
Please don't cross post. It's rude. Read the forum guidelines.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Sorry Paul, actually It was my mistake to post in this wrong section, later I found that ASP.NET section is there for this category so I posted there too.
But I did not understand why it should be rude ! I apologize for my ignorance but I am just curious about this rule. I thought, I can acquire more knowledge by getting more response from both sections from more replies by different experts, is not it acceptable ? Anyway, Sorry again for my ignorance.
|
|
|
|
|
bashiwala wrote: was my mistake to post in this wrong section
No big deal.
bashiwala wrote: I thought, I can acquire more knowledge by getting more response from both sections from more replies by different experts
Most of the people that respond in these forums respond to more than one forum, so cross posting in other forums is not really likely to change the amount of responses you may get ( other than the don't cross post responses ).
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
It's considered rude because it makes it difficult for people to collaborate on a solution if replies are being recorded in multiple forums. It also makes it harder for people searching the forums to find the definitive answer to a question. When posting a question, consider which forum is most appropriate. Most people who answer questions, including myself, look at posts in all the main forums. Cross posting won't help you get a better answer to your question, but it will p*** people off .
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|