|
I did'nt get your requirement regarding calculation...can you be specific as to what you need to do...?
regarding inserting data , you can do something like this
sqlConnection con = new SqlConnection(Connectinstring);
SqlCommand cmd ;
cmd.Connection = conn;
foreach(DataGridItem <name> in <yourdatagridname>.Items)
{
string qry = "insert into(column names)(<name>.Cells[int index] ,.........)";
cmd.CommandText = qry;
cmd.ExecuteNonQuery();
}
Hope this helps..
Thanks
|
|
|
|
|
I have two files that I want to merge.
File1.ini
[COMP]
comp1
[PORT]
3567
file2.ini
[COMP]
comp3
[PORT]
3561
I want to merge these two files to create a file3.ini
File1.ini
[COMP]
comp1
comp3
[PORT]
3567
3561
Any body has a sample code. Any help will be greatly appreciated
|
|
|
|
|
Use a streamreader and writer to append to file3.ini.
|
|
|
|
|
perhaps you should consider xml configuration for your software... it's much easier to manipulate xml files using .net classes in such case. you have plenty of articles about that on codeproject.
|
|
|
|
|
I did find several examples using XML, unfortunately, the application is hard coded to look for file1.ini
thanx for you help
|
|
|
|
|
I Want to convert from decimal number to binary number.
the decimal number is a fraction example .125;
Please help me
|
|
|
|
|
|
AFAIR, the binary rendering of a number is written the same way the decimal rendering is: with a decimal separator inbetween (I'll use the dot here).
So, I'd dare and say that 2.45 equals 10.101101
You'd think that, if you have no way to specify a binary representation of a float, you could still format the two parts and put them back together.
I am really just not sure if this is the correct way to represent a binary fraction...
|
|
|
|
|
I have this code ... I am getting an error when I declare a delegate Event
this.ChangeFilter += new System.EventHandler(this.ChangeFilter);
Error says Cannot assign to 'ChangeFilter' because it is 'Method Group'
private void ChangeFilter(object Source, System.EventArgs e)
{
// Response.Redirect("SelectSchema.aspx");
FilterByResolved(ddlResolvedFilter.SelectedItem.Value.ToString());
}
private void FilterByResolved(string strResolvedFilter)
{
strResolvedFilter = "ISCOMPLETE=" + strResolvedFilter;
try{
this.oracleDataAdapter1.Fill(this.LogDataSet1);
DataView LogFilterView = new DataView();
LogFilterView = this.LogDataSet1.Tables[0].DefaultView;
LogFilterView.RowFilter = strResolvedFilter;
DataGrid1.DataSource = LogFilterView;
DataGrid1.DataBind();
}
catch (Exception ex)
{
Label2.Text = ex.Message;
}
}
Thanks
|
|
|
|
|
I have this code but some how when I click on Hyperlink to sort it doesn't sort. I am sure I have a bug I can't figure it out ... I will really appericiate if any one can see any errors ...
In .aspx file
|
|
|
|
|
Hello,
I have created a typed dataset using a schema,
I am trying to create an instance of this dataset and get the row count.
It always returns total count as 0, when I know for sure taht there are 3 records, what am I doing wrong.?
InstrumentSettings ds = new InstrumentSettings();
ds.ReadXml(@"C:\Instruments.xml");
int x = ds.Instument.Rows.Count;
MessageBox.Show (x.ToString())
Thanks,
|
|
|
|
|
I remember having the same problem a while back and none of the second parameters I tried passing to ReadXml worked. Oddly enough, using a plain DataSet object worked like a charm.
Hopefully someone here will shed some light.
Regards,
Alvaro
... since we've descended to name calling, I'm thinking you're about twenty pounds of troll droppings in a ten pound bag. - Vincent Reynolds
|
|
|
|
|
i want to create SPSS file (.sav) in c#.net. i try searching on net, but could not find anything. if anyone know how to create SPSS file in c#.net please let me know. rigth now i am creating SPSS file manually.
Thank you,
SA
|
|
|
|
|
I can't believe I actually miss pointers and DDX! We recently started to migrate from VS6 C++ to .NET C#.
I have a form #1 with a comboBox control which contains 3 comboBoxes. The form also has a button on it which when clicked brings up another form with an instance of the comboBox control.
What do I have to do to get the original comboBox #1 to update to the same item selected when the user changes comboBox #1 on form #2???
Thanx,
Tom
|
|
|
|
|
You can do this using databinding, or use events to monitor changes. For example:
class Form1
{
public Form1(ComboBox theComboBoxFromForm2)
{
theComboBoxFromForm2.SelectedValueChanged += MySelectionChangedFunction;
}
void MySelectionChangedFunction(object sender, EventArgs e)
{
this.comboBoxOnThisForm.SelectedItem = ((ComboBox)sender).SelectedValue;
}
}
As I mentioned, you could also do this with databinding. You also do not have to pass the combobox into the constructor; you could setup a public get/set property and do it there. Or you could have some governing code that sets it all up for you. There are many different ways to do this with object oriented programming; you just need an instance of each combo box accessible to some piece of code, and you're good to go.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
There are several ways to do this. You can monitor the combobox events on form2 from form 1 as Judah Himango posted or you can create your own custom events on form2 and montior those from form1.
Those are close to the same so the code example is for this last one: if you are showing form2 using ShowDialog you could always check the properties of form2 after it has closed on your form1.
<br />
class Form1<br />
{<br />
public void Button1_Click(sender object, System.EventArgs e)<br />
{<br />
Form2 frm2 = new Form2();<br />
<br />
frm2.ShowDialog();<br />
<br />
this.DropDownList1.SelectedIndex = frm2.DropDownList1.SelectedIndex;<br />
<br />
frm2.Dispose();<br />
}<br />
}<br />
<br />
Like we said there are many ways to do this and which you choose depends on what you are trying to accomplish.<br />
-Richard
|
|
|
|
|
Hi there
I have a problem where the designer does not support manipulating my third party controls. They can be manipulated programatically with ease. However i would like to exploit the designer for at least previewing the changes.
What i initially wanted to do was insert a method call into InitializeComponent() so that my changes would be picked up in the designer for previewing. But i guess this isn't the way to go?
Anyone any thoughts? or suggestions on how i could achieve this?
Cheers
Richard J
|
|
|
|
|
Hi. I built a client/server system that communicates with sockets. I used System.Net.Sockets.TcpClient and NetworkStream. I wonder if there is a simple way to encrypt the data so that it can not be viewed from outside. Would be greatful for any help
/Robert
|
|
|
|
|
There are plenty of built-in classes to aide you. See the System.Security.Cryptography namespace and its members.
|
|
|
|
|
|
Hello,
I'm developing a windows form client application. It has to work with our server application.
Our server application is a scanning application which needs .tiff files.
What I want to do is to "scan" digital documents such as .doc, .rtf, .pdf, .txt and convert them to .tiff files so the server can handle them. One problem I don't know how to do, and where to start.
So does anyone know a solution for this problem, or at least a direction to look?
Thanks....
Fedor Brouwer
X-Solutions
The Netherlands
|
|
|
|
|
For text, you could just create an in-memory bitmap, draw the text on it, and save to tiff.
For rtf, you should be able to do the same using the RichTextBox control and the DrawToBitmap method of the Control class (.NET v2).
For proprietary, closed types such as doc and pdf, you might need some library to parse them out for custom rendering. I can't help you there; I know there are several PDF reader and writer SDKs out there...I'm not sure if any of them support rendering them to bitmap.
|
|
|
|
|
Following up on Judah's suggestion, you may want to check out this[^] PDF to image converter.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I need to call a win32 api into c#
can any 1 suggest any example program to help me understand the idea.
Please any1 out there reply coz i realy need help...
|
|
|
|
|