|
Here[^] you go. Glad to be of service.
|
|
|
|
|
Nice one...5 from me
I will use Google before asking dumb questions
|
|
|
|
|
Pete O`Hanlon wrote: Glad to be of service.
Too good. One more '5' vote.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Cruel and unusual. I love it!
|
|
|
|
|
Sharing your network? When they get flooded with CP questions, to whom will you outsource?
Luc Pattyn [Forum Guidelines] [My Articles]
this months 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
|
|
|
|
|
My math teacher in high school used to taunt "burger flippers".
The class average was 53%.
|
|
|
|
|
hi there,
i want to print a picture but i want to make it 50% transparent,
any idea how?
Becoming Programmer...
|
|
|
|
|
This[^] article has some handy hints on transparency.
|
|
|
|
|
amazing!!, this article is amazing...!! where was it!!! XD
thanks Pete O'Hanlon
Becoming Programmer...
|
|
|
|
|
Thanks for answering my previous thread friends.by the way let me explain the problem clearly.
I have an aspx file in which the background is image and i want to include a label on that image background in which i want to get the values in that label from the database.when i export this aspx file to pdf the image background gets lost and iam getting only the label which i incuded newly.i want to export it completely into pdf without any data lost,and i want to implement that in coding(c#) for the betterment.the one way came into my mind is that the aspx file is converted into image file and then exported as pdf format.is that possible through c# coding.explain me if there is any other ways to implement it.
pintoo
|
|
|
|
|
Please don't cross post. It's rude and it makes it difficult for people to collaborate on a solution.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
How can I run following command through c#?
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\00\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{F0A37341-D692-11D4-A984-009027EC0A9C}\SETUP.exe" -l0x9 -removeonly
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
Process.Start(@"RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\00\Intel32\Ctor.dll,LaunchSetup \"C:\Program Files\InstallShield Installation Information\{F0A37341-D692-11D4-A984-009027EC0A9C}\SETUP.exe\" -l0x9 -removeonly");
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Hi
I have 2 forms in my C# windows application. I type a value in a textbox in form1 and want to populate the results in a datagridview in form2 but its not getting populated. In form2 i have a datagridview and text boxes whose values are binded from db.
Thanx
csanda
|
|
|
|
|
What is the question here?
I will use Google before asking dumb questions
|
|
|
|
|
Id like source code to do that
csanda
|
|
|
|
|
csanda1 wrote: Id like source code to do that
Well this is not nice to say around here. Tell us what you tried, and what it's not working and then you'll get some help.
I will use Google before asking dumb questions
|
|
|
|
|
Your problem might be the databinding...see where it's done...Maybe we could help you better if you would post some of your code.
I will use Google before asking dumb questions
|
|
|
|
|
Sorry for being vague.This is the code in form 2
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=datatry.mdb";<br />
string Company = txtSearch.Text;<br />
string select = "SELECT * FROM ecmain WHERE CompanyName Like '" + Company + "'";<br />
OleDbConnection datatryConn = new OleDbConnection(strConnection);<br />
datatryConn.Open();<br />
<br />
OleDbDataAdapter da = new OleDbDataAdapter(select, datatryConn);<br />
DataSet ds = new DataSet();<br />
<br />
da.Fill(ds, "ecmain");<br />
<br />
update frm = new update(txtSearch.Text );<br />
frm.Show();<br />
<br />
datatryConn.Close(); <br />
code in form 2
<br />
private void btnUpdate_Click(object sender, EventArgs e)<br />
{<br />
<br />
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=datatry.mdb";<br />
<br />
string select = "Update ecmain SET CompanyName ='" + txtCompany.Text + "' , ContactName ='" + txtName.Text + "',ContactSurname='" + txtSurname.Text + "', Designation='" + txtDesignation.Text + "',TelephoneNumber='" + txtTel.Text + "', Faxnumber= '" + txtFax.Text + "', Email='" + txtEmail.Text + "',City/Town='" + txtCity.Text + "',PostCode='" + txtPost.Text + "',NumberofEmployees='" + txtEmployees.Text + "', Export='" + cbxExport.SelectedItem + "',ExportDestinations='" + txtDestination.Text + "', SIC Product 1='" + txtSic1.Text + "', Product1_Description='" + txtProduct1.Text + "', SICProduct2='" + txtSic2.Text + "', Product2Description='" + txtProduct2.Text + "', SICProduct3='" + txtSic3.Text + "', Product3Description='" + txtProduct3.Text + "', GeneralComments='" + txtComment.Text + "', Complete='" + cbxComplete.SelectedItem + "' Where CompanyName='" + txtSearch.Text + "'";<br />
OleDbConnection datatryConn = new OleDbConnection(strConnection);<br />
OleDbCommand cmd = new OleDbCommand(select, datatryConn);<br />
<br />
datatryConn.Open();<br />
cmd.ExecuteNonQuery();<br />
datatryConn.Close();<br />
MessageBox.Show("Updated successfully!");<br />
}<br />
Easy guys im new to programming
csanda
|
|
|
|
|
where is button1 and btnUpdate? You wrote that the whole code is placed in the second form...you got me confused.
I will use Google before asking dumb questions
|
|
|
|
|
Ok its like this.Form1 has txtsearch and button1 for search.When u type the company name in the textbox and click the button it shows the update form.
This code is in form1
private void button1_Click(object sender, EventArgs e)
{
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=datatry.mdb";
string Company = txtSearch.Text;
string select = "SELECT * FROM ecmain WHERE CompanyName Like '" + Company + "'";
OleDbConnection datatryConn = new OleDbConnection(strConnection);
datatryConn.Open();
OleDbDataAdapter da = new OleDbDataAdapter(select, datatryConn);
DataSet ds = new DataSet();
da.Fill(ds, "ecmain");
update frm = new update(txtSearch.Text );
frm.Show();
datatryConn.Close();
Form2 is named update, it has a datagridview and textboxes, now what i need is when I click button1 in form1 the search results to appear in the datagridview in form2
This is the update code in form 2
private void btnUpdate_Click(object sender, EventArgs e)
{
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=datatry.mdb";
string select = "Update ecmain SET CompanyName ='" + txtCompany.Text + "' , ContactName ='" + txtName.Text + "',ContactSurname='" + txtSurname.Text + "', Designation='" + txtDesignation.Text + "',TelephoneNumber='" + txtTel.Text + "', Faxnumber= '" + txtFax.Text + "', Email='" + txtEmail.Text + "',City/Town='" + txtCity.Text + "',PostCode='" + txtPost.Text + "',NumberofEmployees='" + txtEmployees.Text + "', Export='" + cbxExport.SelectedItem + "',ExportDestinations='" + txtDestination.Text + "', SIC Product 1='" + txtSic1.Text + "', Product1_Description='" + txtProduct1.Text + "', SICProduct2='" + txtSic2.Text + "', Product2Description='" + txtProduct2.Text + "', SICProduct3='" + txtSic3.Text + "', Product3Description='" + txtProduct3.Text + "', GeneralComments='" + txtComment.Text + "', Complete='" + cbxComplete.SelectedItem + "' Where CompanyName='" + txtSearch.Text + "'";
OleDbConnection datatryConn = new OleDbConnection(strConnection);
OleDbCommand cmd = new OleDbCommand(select, datatryConn);
datatryConn.Open();
cmd.ExecuteNonQuery();
datatryConn.Close();
MessageBox.Show("Updated successfully!");
}
csanda
|
|
|
|
|
You can create a public method in the second form, let's say BindData(). After you call the second's form constructor in button1_Click event, you call that method before showing the second form. Like this:
update frm = new update(txtSearch.Text );
frm.BindData();
frm.Show();
Make sure that the BindData method is the one that binds the gridview and the textboxes to the database according with the text the form received in it's constructor.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Please don't have direct queries like this. It's just bad practice. Instead, take a look at using Command Parameters - they are your friend, and they remove a lot of vulnerabilities from your application (take a look at this[^] article). Also take a look at this[^] article on passing values between forms.
|
|
|
|
|
Tell me how much you can owe me?. I will take up that task.
Once you have mastered the ability to turn yourself invisible at will, and to deflect bullets with your hair, you will be ready to come back here to the lounge and post programming questions.Only at this point will you be able to dodge the fireballs that are going to come your way. - Pete O'Hanlon
|
|
|
|
|
If your forms are modeless, then in form2, add a string property, in form1, after the user has changed text in the text box, change that property on form2.
if your form2 is modal, then add the string from the text box as a parameter to the constructor of form2.
|
|
|
|