|
Hello. I m stuck with a problem of graph at the end.
I downloaded a source to create a graph in VS 2005. When I run the source it works fine..
There are two ListBoxes in that source, 1st (ul_lbx_DataKey) containing String and 2nd(ul_lbx_DataValue) containing, Float as well as INT...
I want to add data on those listbox from my SQL Server through ADO.NET ... I can add those successfully, but unfortunately, when i click on SHOW GRAPH button, Error Throws..
*There are two listbox 1 and listbox 2
*Datakey = listbox 1 ,, value == listbox2
*No problem in ListBox 1
*Problem in listbox 2.
*When I add STRING item in listbox2, It throws and INCORRECT FORMAT error ////////// --- According to programming this is correct.
*When I add INT item in listbox2, NO error ////////// --- According to programming this is correct.
*When I add FLOAT item in listbox2, NO error ////////// --- According to programming this is correct.
*In database, I changed the datatype of the column binded in listbox 2 .. First I did varchar == ERROR // According to problem, this is correct
*Second, int == Throws Error /// This is WRONG.
*Third FLOAT == Throws Error // This is wrong either.
----------------------------
System.FormatException was unhandled
Message="Input string was not in a correct format."
Source="mscorlib"
StackTrace:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info)
at System.Single.Parse(String s)
at GraphV1.Form1.ui_btn_Show_Click(Object sender, EventArgs e) in C:\Documents and Settings\nt_virus - Dell\Desktop\temp\GraphV\GraphV1\GraphV1\Form1.cs:line 46
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at GraphV1.Program.Main() in C:\Documents and Settings\nt_virus - Dell\Desktop\temp\GraphV\GraphV1\GraphV1\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
---------------------------------------------
I would be very glad, if you will please solve this problem for me.. I wasted my 2 days in it...
Please download the source of that graph from here -- http://is.gd/1dT1
Also, please download my modified graph source from here -- http://is.gd/1dT8
If needed, my small database for test purpose from here -- http://is.gd/1dTc
|
|
|
|
|
|
Point[] points = (Point[])list.ToArray(typeof(Point));
If you can use .NET 2.0 and higher, then I suggest replacing ArrayList by the typesafe List<T> class, like this:
List<Point> list = new List<Point>();
list.Add(new Point(0, 0));
Point[] points = list.ToArray();
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Get a Graphics object from the image, then you can draw with the graphics object:
Graphics g = Graphics.FromImage(pictureBox1.Image);
g.DrawXXX();
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank's for your Help. Its working.
|
|
|
|
|
Hi
Can a UserControl be used in a Column headercell? What I would like to try is create a UserControl containing a label and a NumericUpDown control. This I would then like to use in the HeaderCells of the columns.
Can anyone point me in the right direction please.
Thanks.
Kobus
|
|
|
|
|
If you apply correct padding in the header cell, you place the header text anywhere in the cell. Then probably you can make a NumericUpDown control at the desired location in the cellpaint event.
I havent tried this so not sure if it would work.
|
|
|
|
|
dsProductTableAdapters.productTableAdapter pa = new EBMS.dsProductTableAdapters.productTableAdapter();
int result = pa.InsertQuery(tbxProductName.Text,tbxDesc.Text,Convert.ToInt32(tbxModelNumber.Text),Convert.ToDecimal(tbxMSRP.Text),Convert.ToDecimal(tbxRetailPrice.Text),1,0,1);
the int results return 1. which shows its successfully insert. but inside my access database file does not show the new row..
how do i commit the changes
|
|
|
|
|
Hi,
my application runs some code in each interval.
There the first line looks like int sec = Settings.Default.Intervall;
in my case, the interval setting doesn't change and holds a value of 20, so every 20 seconds Settings.Default.Intervall; is accessed.
the problem is, that sometimes an exception occurs. this happens once a week or so. any idea what the point could be?
FATAL 02.08.08 06:07:52 [ thrCounter]: Ein unbehandelter Fehler ist aufgetreten (sender: Name:Umm.exe
There are no context policies.
, exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at System.Configuration.SettingsPropertyValueCollection.get_Item(String name)
at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
at Umm.Properties.Settings.get_Intervall() in D:\VSSTools\Umm\Entwicklung\Properties\Settings.Designer.cs:line 31
at Umm.App.Controler.runIntervallWaiting() in D:\VSSTools\Umm\Entwicklung\App\Controler.cs:line 213
|
|
|
|
|
It looks like your SettingsPropertyValueCollection is getting corrupted, so that the values in the _Indices HashTable doesn't correspond to the size of the _Values ArrayList.
The class itself should be pretty well tested, so there might be something in your code that is accessing some memory that it shouldn't. Typically that's only possible when using reflection, unsafe code blocks or calls to unmanaged code.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
greetings,
I am trying to write a program that will communicate with another application using xml messages over tcp/ip.
The host machine has a public IP address and i will send the xml messages to a particular port number.
The documentation of the host application makes numerous references to socket programming so i'm guessing that is a hint to any potential users.
So I was wondering how i can use dot net (C#) to the following:
firstly, create the xml documents(xml messages)
secondly, send these xml documents over the network over tcp/ip sockets
thirdly, view the response from the host machine
|
|
|
|
|
Use XmlDocument to create XML. Then you can send the complete string of that XML (xmlDoc.OuterXml) using TcpClient. Then using TcpClient you can also wait for the response.
|
|
|
|
|
You can send them as byte array after adding headers to distinguish messages from each other.
Edit: removed typo
modified on Monday, August 4, 2008 4:44 AM
|
|
|
|
|
I have same type of problem, so pls provide a solution...
|
|
|
|
|
Hi,
Kindly let me know or give me examples link that how to add combobox into datagridview?
Thank in advance
(Riaz)
|
|
|
|
|
|
I have used the web browser control in my C# Windows Application. And i have written following code in that application for previewKeyDown event of webbrowser control.
But when user press the key M , Message box should be displayed once. But it is displayed twice.
Source code:
private void webBrowser1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyData== Keys.M)
{
MessageBox.Show("User has pressed key M", "Key press alert");
}
}
actually event of key press occurs once. But message box is displayed twice . Need help ?
Thanks in Advance.
|
|
|
|
|
it comes only once in my test app. see first, if :
this.webBrowser1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.webBrowser1_PreviewKeyDown);
called twice...
|
|
|
|
|
First message box comes but when you click on Ok button same message box appears again on the screen. that event occurs again. how this happens ?
|
|
|
|
|
Have you accidentally added the event hook twice somewhere? That would be the most logical explanation.
|
|
|
|
|
hi all,
I want to add a custom plus minus control infront of every node in a treeview structure in c#. But i don't want to use DrawDefault property.Can anyone help me in doing this.
Thanks
|
|
|
|
|
is this the same question as clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Ya this is the same question.But i have not got the answer to the question. i want to do it in c#.
Thanks
|
|
|
|
|
if u know plz let me know.
Suresh
|
|
|
|