|
OK, so what are asking? Are you asking how to do it? Are you asking for someone to do it? Are you having issues with doing it?
Also, please read this[^] and look at item #3. "Can anyone help plz" is not a very descriptive subject.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Search for "how to read registry" or look at the RegistryKey class in the MSDN doc[^].
|
|
|
|
|
Three days later...why are you responding to my post instead of the OP?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Maybe I was careless and should have responded to his. I am terribly sorry for the inconvenience.
|
|
|
|
|
Hi all,
I have a datagrid with 4 columns, 1st column is a combobox named "clmOptionNames" where i need to load the values from an combobox named "toolStripComboBox1" who is located outside the datagridview, the rest of the datagrid have values from a webservice and is loaded through the datasource.
Is there anyone who know how to get the content from one combobox and then insert it into a datagridview combobox? the combobox is located at column 0 in the datagridview.
|
|
|
|
|
ah forgot to drop in my code....
frm_Rights frmRights = new frm_Rights();
if (toolStripComboBox1.Text.ToString().Length != 0)
{
frmRights.label1.Text = toolStripComboBox1.Text.ToString();
frmRights.dataGridView1.Columns[1].HeaderText = "User Name";
frmRights.dataGridView1.Rows.Add("", "user1", "16-08-1971", "16:00:00");
frmRights.dataGridView1.Rows.Add("", "user2", "24-08-1983", "12:00:00");
BindingSource bindCombo = new BindingSource();
bindCombo.DataSource = toolStripComboBox1.Items;
DataGridViewComboBoxColumn datagridCombo = new DataGridViewComboBoxColumn();
datagridCombo.HeaderText = "Hello";
datagridCombo.DataSource = bindCombo;
frmRights.dataGridView1.Columns.Add(datagridCombo);
frmRights.ShowDialog(this);
}
The above code works well fine enough - only with the exception that it dont load the content into column 0 but just add a new column onto the datagridview.
|
|
|
|
|
codeproject-template.zip is empty, there is a thread with three posts saying this but no answer in a month, so I just wondered if anyone had a copy and could publish a link to it.
Thankyou
I had to sign up, I felt a bit guilty borrowing code ideas and not giving anything back.
|
|
|
|
|
|
Yes, because the code I want to post is C#.
I had to sign up, I felt a bit guilty borrowing code ideas and not giving anything back.
|
|
|
|
|
Rassler48 wrote: Yes, because the code I want to post is C#.
Can you tell me which template you are interested in?
|
|
|
|
|
|
hello,
i discovered this page because of an important need of a c# programm which enables me to plot a mathematical funtion im calculating with my own c# program.
i discovered : 2D Math Curve Presentation for your Project which is exactly what i need: easy and simple.
The problem is that it wont work -due to its date
is somebody able to fix the 2 errors?
Error 1 The call is ambiguous between the following methods or properties: 'System.Math.Floor(decimal)' and 'System.Math.Floor(double)' C:\Documents and Settings\admin\Local Settings\Application Data\Temporary Projects\WindowsApplication2\CurveCalc.cs 291 26 WindowsApplication2
error 2
message loop on a single thread is not a valid operation. Use Form.ShowDialog instead.
to this function:
Application.Run(new GraphPlot(funcstr,xs,xe,nump));
waiting for comments
|
|
|
|
|
Normally I would say you should ask in the article's forum but the author doesn't seem to respond to messages there.
THe first problem is because the Math.Abs function returns an int so the Floor method doesn't know which overload to use. The easy way around this is to cast the result to a deciaml or double depending on your needs:
redwx=(int)Math.Floor((decimal)(Math.Abs((int)Math.Log10(lox))));
I don't get the second error at all, if I remove the default Program.cs and replace it with the MainFile.cs all works perfectly.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
At first i have to thank you for looking in the code and your effort.
I call the funtion from a class within a public void method and it wont work. I have no idea what [STAThread] in line 8 of the original mainfile does. maybe it's because of that?
P.s: "Normally I would say you should ask in the article's forum but the author doesn't seem to respond to messages there." Thats exactly why i posted here.
|
|
|
|
|
MSDN/Google is your friend, Single-Threaded Apartment.
You probably don't need the MainForm class at all - all you probably need is to copy the code inside the Main method to your own method and instead of the Application.Run, just intanciate then display the form.
GraphPlot graphPlot = new GraphPlot(funcstr, xs, xe, nump);
graphPloat.Show();
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Seeing as it's a graph you should cast it to double. Decimal would work too, but is more expensive and offers no benefit in this application.
Try this: Open a new tab. Type "javascript:alert(0.1+0.2)" in the address bar. Now gape at the result, which is close to but not quite 0.3 - and read on to stop gaping.
Decimal is a type that can represent decimal numbers accurately. Computer hardware is of course made for working with binary numbers.
It is not possible, in general, to represent numbers in different bases accurately using the same number of digits, and sometimes not using *any* number of digits (though it is always possible to represent rational numbers as ratios in any base, and never possible to represent any irrational number as a ratio, in any base). For example, one third is an infinite sequence in base ten (0.33333333...) but it is simply 0.1 in base 3.
Decimal is useful in financial applications where it matters that base-ten numbers are exactly represented, but they are comparatively slow since your computer hardware doesn't have instructions to do arithmetics with them. The type must instead provide a software algorithm that manipulates the bits representing a decimal number. By all means, you'll probably never notice any difference, but in general, use double whenever you don't need an exact decimal-number representation. This is a case of drawing a graph, hence of mapping the value in question to a pixel, and it resolutely doesn't matter if it always snaps to the pixel it would have done if you used a decimal, so clearly the correct choice is double.
|
|
|
|
|
Hi,
I need to alter table programatically in dataset, I need a new column.
Can you please give some example/article about it.
Daniel.
|
|
|
|
|
DataTable dt = ?;
dt.Columns.Add(new DataColumn(typeof(DateTime));
An article about this one statement would seem overkill.
|
|
|
|
|
Hi,
I want to know what's the best way to return value from a fuction in a web service. Presently, a true value is returned if function ran successfully and a false value if not.
So my question is how can i return a value in between them (like true and false value). For instance, a function can get crashed while doing something inside, connecting to the database or couldn't delete a locked file and several other reasons.
I have created functions like these.
public bool AddUser(string username)
public bool DeleteUser(string userID)
public bool GetUser(string userID)
public bool DeleteFile(string fileID)
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:00am.
|
|
|
|
|
I am wondering if you even read my question completely in the message. I am already returning true or false value from a function. But I want to know how could i pass a detailed error message if function crashes rather than a false value.
|
|
|
|
|
Return as Int value. Examples:
0 - Success
1 - Invalid User name/Password
2 - Can not connect to database
PS: Returning as Enum can be a little easier
PPS: You can create a Struct that has Error Code, and a message. This way you can handle error by its Code and if user needs a info, you could show the message part. There are a lot of ways to achieve this
modified on Friday, November 20, 2009 12:46 PM
|
|
|
|
|
Is this way big applications deal with complicated applications issues?
|
|
|
|
|
Some WinAPI calls handles errors with either int value or has GetLastError(). I have tried MySQL connector.NET and they have tons of errors. In their way they returned a custom Exception. That exception includes ErrorCode and a Message
This is how Microsoft uses:
System Error Codes[^]
netJP12L wrote: Is this way big applications deal with complicated applications issues?
Not sure, but this approach I saw in C++ coding style
I Suggest you chose one and stick with it. If you choose returning as Int, Make sure you are documenting every error code and maybe even using constant
|
|
|
|
|
If you re-throw the exception, then you can provide all the details you might need, and just have it return false. Alternatively, raise an event with the exception details, and know that if you return false you need to check a variable with the reason for failure.
|
|
|
|