|
|
I ran the code and I did not received that exception. What are you trying to do exactly?
~javier lozano
(blog)
|
|
|
|
|
I'm trying to invoke the static method ComputeSum using reflection, this example is to show my problem, but it is part of a larger project. I'm using VC#S 2005 beta + .net 2
Thanks
|
|
|
|
|
I get a dialog error box during debug which reads:
"No source code available at the current location"
when the folowing code executes:
public DataSet Query(string Table,string QueryString)
{
try
{
DataSet dsDataSet = new DataSet();
SqlDataAdapter dbData = new SqlDataAdapter(QueryString,dbConn);
dbData.Fill(dsDataSet,Table);
return dsDataSet;
}
catch(Exception Err)
{
throw new Exception(Err.Message);
}
}
This same code has been running fine for months, now when I went back to re-work a certain application, it now errors out on the Fill method. But not all the time.
This is driving me crazy since the error is sporatic.
any help out there?
I'm positive that both parameters are valid, I've checked them many many times.
|
|
|
|
|
One would imagine that there is no source code available because it's blowing up within the DB call, and that it probably blows up depending on the query string
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Well if there is something wrong with the query strin you'd think it would throw an exception rather than blowing up. But that aside, its not the string, because it doesn't blow up every time and the Query string is the same everytime.
|
|
|
|
|
This just means something else is handling the exception rather than your code. When the debugger is attached and exception is thrown that is not caught the debugger steps in and tries to show you where but fails because there is no pdb or the source never existed.
Without more information who knows what is wrong.
|
|
|
|
|
Well get this. I reinstalled VS.NET and the problem is gone.
Don't know why or how....something must have gotten corrupted.
What a waste of time.
|
|
|
|
|
Is there a way to debug an ActiveX control written in VB6 using an exe written in C#???
I know that COM Interop creates some intermediate things that .NET can understand and deal with.
My .NET app uses the control from VB6 and raises an error on exit - so I only can guess that the problem is inside my VB6 control. But how can I debug it???
Vad.
|
|
|
|
|
I could be wrong here, but you could run the control under the debuggers in VS.NET 2002/2003. But, you can't make any changes to the code without recompiling the control with Visual Basic 6. The VB.NET compilers won't work for you in this case because they don't target ActiveX control natively.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, I can run my control under VB.NET but first I would have to convert it into compatible VB.NET code. Such convertion would force me to make many changes to the code because my control is rather complicated and it could happen that the reason of error would eliminate by itself...
Nevertheless, thanx for advise. I will mind if I find nothing more!!! ))
|
|
|
|
|
Hi,
Not sure if this has been commented already, I searched for it, but nothing showed up.
I am having a weird problem: I've been developing an application for 3 months already, but since a couple of days ago, every time I put a new icon in a form, it shows in design mode, but it doesnt show up at run time. This happens even with old W3.1 icons, and on different forms. Icons I was working with normally, refuse to show if I add them again in a different form.
This is driving me mad since I dont have a clue about what could be causing this. Maybe my Visual studio 2003 has gone nuts? Out of memory?
Any help would be GREATLY appreciated
Thanks in advance
|
|
|
|
|
What I would recommend is doing a search over the entire file set to see if the Form.Icon is being set elsewhere. It is easy to forget that old code did something important that is no longer necessary but not interferes.
|
|
|
|
|
Hi everybody,
which control event will be fired before the change of a checkbox or radiobutton happens, and how to say the system not to change ?
Depending on a condition I want to allow or forbit the user to change the status of a checkbox or radiobutton, without setting the control to disable (or to readonly) ?
A dummy.Select()command (jump to another control) doesn't work.
Thank your for your time
Frank
fracalifa
|
|
|
|
|
There is no such event in the System.Windows.Forms.CheckBox or RadioButton classes, but you can extend the classes and raise the event.
Following is the crude (not refined) code. It has transient greying in beetween the check state Changes. Please rectify it if possible.
public class MyCheckBox : System.Windows.Forms.CheckBox
{
bool cancelStateChg = false;
public delegate void BeforeStateChangeEventHandler(object sender, ref bool cancelStateChange);
public BeforeStateChangeEventHandler BeforeStateChange;
protected override void OnClick(EventArgs e)
{
if(this.BeforeStateChange != null)
{
this.BeforeStateChange(this, ref cancelStateChg);
}
if(this.cancelStateChg)
{
this.Checked = !this.Checked;
}
base.OnClick (e);
}
}
|
|
|
|
|
Hi Jay,
it's a pretty good solution.
It works fine and inspires to modify more than one control.
Thanks a lot
Frank
fracalifa
|
|
|
|
|
welcome, actually I wanted to trap BM_SETSTATE window message and do the overriding, but because of the time limitation, I could not do R&D on that. This solution, I had build up just after your post, but waited for others for posting you some better solutions.
Any way, Thanks a lot for using the solution.
Regards,
Jay
|
|
|
|
|
hi,
I am just wondering how can i make Context Menu pop-up.. only if an item is selected in a ListView Control....
any help will be greatly appreciated...
thanx
|
|
|
|
|
this should work:
private void listView1_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button==MouseButtons.Right)
{
if (listView1.GetItemAt(e.X,e.Y)!=null)
contextMenu1.Show(listView1,new Point(e.X,e.Y));
}
}
If ur gonna use this feature many times in your code, it may be better to create ur own control inheriting from ListView and override the OnMouseUp method with this same code.
P.D: Dont set ur ListView's ContextMenu property anywhere in ur code or via designer. Keep it Null.
|
|
|
|
|
I have a network application which requires a matrix of boxes. So I decided to take label boxes with borderstyle as fixedsingle. Now each label acts as a box. Upto it is nice. But I need the main player to decide the size of matrix and this size example 8 X 8 matrix is send over the network to the sub player. Now by this size the sub player application has to draw these label boxes on the form. I don't how to do this. It is very urgent for my project.
One more thing, All network operations are implemented in networkoperation.cs and application form class is Form1.cs . I have a reference to Form1 object as myform in networkOperation.cs class.
Please help me in this regard as soon as possible.
|
|
|
|
|
Hello,
I need to know at design time if a Control i created is being resized using the left grip or the right grip (only can be resized horizontally), because i need different behavior for each scenario.
I have a ParentControlDesigner inherited designer for my control (used for setting SelectionRules, and Serialize a few properties to InitializeComponent, etc.)
The only workaround i found to know is to test if the location changes upon resize (though it's pretty dirty, since i need to delay with a sleep the setting of an "old" location)
Could anyone explain what service of the designer i should use and how, to know what grip is used upon mouse resize please ?
Thanks,
Etienne.
|
|
|
|
|
"...Control I created...": I'm assuming u have created your own user control and will add it to your app's forms. In that case:
how about checking where the mouse is when resizing? Overriding the control's OnSizeChanged method you should be able to tell if the mouse is to the right, left top or bottom of ur control.
Unless ur also interested in which way the resizing is going to go (making control bigger or smaller), ur all set.
This code will run in design time same as in runtime so you dont need any special designer service.
|
|
|
|
|
hello,
I inherit the NameObjectCollectionBase for creating custom collection class.
This way i create a collection of my own objects.
My problem occurs when i use the following statment:
"foreach(object person in PersonsCollection) {}"
Instead of getting the objects in person, i get the keys.
This problem preventing me from assigning my collection to datalist because the values i get are the keys (string) and not the their objects that i added to the collection.
what can i do?
Eran
|
|
|
|
|
// this type of thing
foreach( object key in PersonsCollection)
{
Person person = PersonsCollection[key] as Person;
}
Gary
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'
- Dilbert
|
|
|
|
|
I have a c# app that communicates with a c++ app. I am trying t send some data to the c++ app using a binarywriter...
// socket is a connected and working Socket
socketStream = new NetworkStream(socket);
socketWriter = new BinaryWriter(socketStream);
...
byte[] bytPrefix = new byte[2];
bytPrefix[0] = 0;
bytPrefix[1] = 0;
byte[] bytLength = System.BitConverter.GetBytes(textWriter.GetStringBuilder().Length);
byte[] bytMessage = System.Text.Encoding.ASCII.GetBytes(textWriter.GetStringBuilder().ToString());
byte[] bytSend = new byte[2+4+textWriter.GetStringBuilder().Length];
bytPrefix.CopyTo(bytSend,0);
bytLength.CopyTo(bytSend,2);
bytMessage.CopyTo(bytSend,6);
socketWriter.Write(bytMessage);
socketWriter.Flush();
...
The c++ app gets a message ok, but it is missing the first 6 bytes. (if I put a break before the Write() bytMessage[0]-[5] are correct
Am I doing something incorrectly?
it seems that any non-text data I put at the beginning of the message is not sent...does the binary writer filter what it sends?
Thank You
|
|
|
|