|
|
hi.. if i create project using wpf.. drag a button into the form.. how do i get to the event for the button_click ? i cant double click tat...
|
|
|
|
|
Hi,
You can just add eventhandler for the button in code-behind file as follows :
button1.Click += new RoutedEventHandler(button1_Click);
Regards,
Ujjaval Modi
|
|
|
|
|
where is the code behind the file? where to put the code?
wht i was forced to do is open the blend.. and get click on the event button click to show the code.. hahaha
|
|
|
|
|
|
Hi,
iam doing windows application with c#..
i have to insert datagridview rows into database...
with my code data is inserting into database and at the same
time it is giving error ("unhandled datatype mismatch")
i check with all my database datatypes and text what iam typing.
so please provide some help..
mycode is
string connection = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data source= D:\inventory\management\management\database\muralicell.mdb";
OleDbConnection myconnection = new OleDbConnection(connection);
myconnection.Open();
for (int i = 0; i < inwardgrid.Rows.Count; i++)
{
string insproducts = "INSERT INTO product_details(productid,Invoice_number,productname,units,received_date)VALUES('" + inwardgrid.Rows[i].Cells[0].Value + "','" + inwardinvno.Text + "','" + inwardgrid.Rows[i].Cells[1].Value + "','" + inwardgrid.Rows[i].Cells[2].Value + "','" + inwardrecdate.Text + "')";
OleDbCommand insprocommand = new OleDbCommand(insproducts, myconnection);
insprocommand.ExecuteNonQuery();
insprocommand.Dispose();
}
myconnection.Close();
murali krishna
|
|
|
|
|
Hi,
Just try to put your code in try & catch block. Because you are getting datatype mismatch error. The conflict is between the data you are passing and the data-type of the fields in database.
May be error is due to date field.
Regards,
Ujjaval Modi
|
|
|
|
|
hi all
help me how to code in c# to
pass the texbox values present in form1
to form2 for a button click event
.
i had coded lik this ina button click of form1
private void btnEdit_Click(object sender, EventArgs e)
{
frm2.Show();-----i had created frm2 object above this click event
frm2.TextBox1=txtAreaName.Text;----> this code doesnt works. i mean here to pass the textbox value of form2 to textbox in form1.
}
pls help
thank you
senthil
|
|
|
|
|
There are many ways to acheive this, the easiest is to adjust the constructor for form2 to accept a textbox argument and store that as a variable in the form2 class in the constructor. Then you can access or change any of the form1.textbox properties from form2.
|
|
|
|
|
|
Hi,
I am working on the Ado.Net Entity Framework and I want to know the how it is best over the Ado.net considering the performance.
Thanks,
Sarang
|
|
|
|
|
Hi, I'm using the RequiredFieldValidator and ValidatorCalloutExtender in the UpdatePanel. The Validator is ok for the first time,but after that I face a problem when the control is blank, the error is : ControlToValidate is null.
Can somebody please help me.....
#ps: i m using AjaxToolKit...
Thanks....
|
|
|
|
|
Hi
I have a web browser object that loads a given page, and once its loaded i want to extract all the images from the DocumentStream and get them in an Image or Bitmap format.
Anyone know a way of doing this?
I have tried several methods but none seem to work.
I've noticed that right click > Save As seems to be instant, ie not redownloading the picture, which is my goal. Any idea what methods Save As uses to save it without redownloading?
Any help appreciated...
|
|
|
|
|
I am a bit confused about using the InvariantCulture flag while converting a string to double.
Can someone please guide me as to how do we take care that when we are converting a string to double it should work in different culture settings(like English which uses "." and french which uses "," for decimal separators). My idea is that if I give the InvariantCulture flag then Double.Parse or Convert.ToDouble can convert any string correctly.
Thanks,
Pankaj
|
|
|
|
|
Hi all, I've a problem with remoting: in order to connect to a remote object I have to open a port on the server. But then the server also asks for a connection with the client and the port used is random if in the client remoting file there is
<channel ref="tcp" port="0" exclusiveaddressuse="false">
or the specified port otherwise. My problem is that if I have to go behind a firewall I have to open the port, so I specify a port but then... when I try to start a second instance of my app I get an exception because the channel is already in use. I could ask the customer to specify a set (or range) of ports, but I wonder if there are better alternatives. For example, how do applications like P2P or web browser deal with multiple connection? I suppose that they have to accept incoming connections as well...
modified on Friday, December 07, 2007 3:25:47 AM
|
|
|
|
|
In my logging code, I want to display the name of the method that wrote to the log. How can my Log method get the name of the method that called it?
I'm thinking of something like the .TargetSite of an Exception (except I'd prefer not to throw an exception ... unless that's how to do this).
|
|
|
|
|
Let me make this more generic:
- how, in code, can I stop and get the stack trace up to that line of code? Hopefully I can do this without stopping and throwing an exception and reading the stack trace from the Exception object. I'm sure that's a performance hit...
|
|
|
|
|
By using System.Diagnostics.StackFrame like this:
public static void Main()
{
Func();
RL();
}
public static void Func()
{
//Get stack with line numbers
System.Diagnostics.StackTrace Stack = new System.Diagnostics.StackTrace(true);
foreach(System.Diagnostics.StackFrame Frame in Stack.GetFrames())
{
WL(Frame);
}
}
|
|
|
|
|
Thanks. That is exactly what I was looking for. Unfortunately, I never got email about your reply! So I went through the Help files and found this myself. I was just coming back to answer my own question when I saw your reply.
However, I'm curious how expensive *this* is, too...
|
|
|
|
|
hi
i want that where i click on dataGridView1, his value
will apire in textbox2
how to do that ?
|
|
|
|
|
http://www.codeproject.com/KB/cs/Drag_Drop_from_GridView.aspx
from the above mentioned article see how to detect which cell is pressed when u get the right cell than it will be easy for u to show it's value in textbox
|
|
|
|
|
Hi All,
I am working on a project using C# 2.0. I need the functionality in my project that at the runtime, when I resize the form by dragging its border using the mouse , all the controls within the form should resize as well. Please help.
Thank you.
A.Asif
|
|
|
|
|
|
u have to use Anchor and Dock property intelligently.
|
|
|
|
|
Putting all your controls in a table layout panel will make it easy.
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|