|
I found two debugging problems running my program on new operating system. It contains Visual Studio, and I run Debug version. Results of Release versions are the same.
1) Program doesn't report correctly about missing Dll. C# executable depends on C++/CLI Dll, which is linked to unmanaged Dll. Unmanaged Dll is not found, and program reports "Module not found" exception in some completely unrelated code fragment. Message doesn't contain missing Dll name. I fixed the problem, but why error message is not informative?
2) Exception dialog contains two buttons: Debug and Close. I remember that before reinstalling OS this dialog looked different. There was the button "Details" and I could see full exception stack without running debugger. What settings should I change to get such dialog?
Palestine
|
|
|
|
|
We are currently moving from .Net 1.1 to .Net 2.0. We are using an external DLL provided by a hardware supplier. This DLL is written on .Net 1.1. I now want to port it to .Net 2.0 but I don't have source codes so I cannot recompile it (I tried decompiling but the generated code won't compile). Is there a tool or something that can directly port the DLL to 2.0 so that it is all .Net 2.0 based?
Palestine
|
|
|
|
|
You don't need to recompile the DLL to get it to run on .NET 2.0, it should do it without any extra work. Just import and use in your .NET 2.0 application.
WM.
What about weapons of mass-construction?
|
|
|
|
|
i use this code.. but it's not working.
i use visual C# 2005.
in my selection string there are 3 parameters (:PARAM3)
this is just one sampje
the error is :
The best overloaded method match for 'string.this[int]' has some invalid arguments
so i have to put it to string somewhere.. but i don't know how and where
can anyone help me?
if (textBox2.Text == string.Empty)<br />
{<br />
dBANBM_T075_BORGTOCHTTableAdapter.Connection.ConnectionString[":PARAM3"] = "%";<br />
}<br />
else<br />
{<br />
dBANBM_T075_BORGTOCHTTableAdapter.Connection.ConnectionString[":PARAM3"].Value = textBox2.Text;<br />
}
|
|
|
|
|
Int32 x = 10;<br />
String text = x.ToString();
As simple as that
WM.
What about weapons of mass-construction?
|
|
|
|
|
but where should i put this..
my value of my param2 is given while running the application.
this actually i did know.
but how to implent it in my application is the question
|
|
|
|
|
COnnection.ConnectionString returns a string according to the documentation[^]. So trying to use a string-indexer will fail. The error message says:
The best overloaded method match for 'string.this[int]' has some invalid arguments
which is to say you can use a numeric-indexer on a string variable, to retrieve the character at that index.
string myString = "HelloWorld"
char firstChar = myString[0];
firstChar would contain the letter 'H'
You should tell us what you are trying to achieve, rather than how you are trying to achieve it - that way maybe someone can give you more help.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
On what line do you get the error?
You are using the Value property on only one of them. Shouldn't be on both?
---
b { font-weight: normal; }
|
|
|
|
|
both line's give the error
what i'm trying to achieve is the following
i've got one datagrid, 3 textboxes and a button
in the textboxes you can fill in a value wich should be param2, param3, param4.
on this values he will search my database.
select * From Table where (Column like :PARAM2).
if there's no value he fills in a wildcard.
if i don't do that he's got a empty parameter so he won't be able to select something.
the button fill's the database with the parameters.
en show's the data in the datagrid.
that's the idee.
i'de had it working on visual studio 2003.net
also with c# and using a Oracle database
now visual C# 2005 and a acces database.
so once the code did work.
hopefully this make some sense
|
|
|
|
|
The ConnectionString property returns a string. You cannot index into a string with a string value...
dBANBM_T075_BORGTOCHTTableAdapter.Connection.ConnectionString[":PARAM3"] = "%";
As the compiler error told you, you have to index into the string with an integer (a whole number).
dBANBM_T075_BORGTOCHTTableAdapter.Connection.ConnectionString[4] = '%';
Most likely what you are trying to achieve is something like this:
string val;
if( textBox2.Text != string.Empty )
val = textBox2.Text;
else
val = "%";
dBANBM_T075_BORGTOCHTTableAdapter.Connection.ConnectionString = dBANBM_T075_BORGTOCHTTableAdapter.Connection.ConnectionString.Replace( ":PARAM3", val );
Josh
|
|
|
|
|
in the last case he doesn't give my param the value of "val"
|
|
|
|
|
|
he is my program
this is the code i use now
<codeval;
if( textbox2.text="" !="string.Empty" )=""
val="textBox2.Text;
else" "%";dbanbm_t075_borgtochttableadapter.connection.connectionstring="dBANBM_T075_BORGTOCHTTableAdapter.Connection.ConnectionString.Replace(" ":param3",="" val="" );<="" code="">
the "val" get's his value form the program. that is the % if the field is empty. or else the value that is typed in the textfield.
but the parameter doesn't get this value
|
|
|
|
|
Hi guys!
need some Help ..
i m trying ti assign values to a resized string array without loosing its old values..
something like this:
string[] myArr=new string[]{"abhinav","gupta"};
Array.Resize(ref myArr, myArr.length+10}
this code increases the length of array
but how to assign the value of the new added Dimensions..without loosing the old values:
i dont want to use :
myArr[3]="some Text";
as the array is dynamic .. and i have to assign more than 50 values in different situations..
is there some other way to asign the values to new increased Dimensions...
abhinav
|
|
|
|
|
Use an ArrayList or if you use 2.0 the equivelant is List<String>
|
|
|
|
|
I am doing a project on binary trees, I need to show very large tree structure graphically on screen, How can make it in c#?
shiva
|
|
|
|
|
Well the easiest way would be with a TreeView control.
You can look at my ThreeTree program to see how you can add nodes to the TreeView control.
Or ware you thinking on drawing the tree yourself?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi, Thanks 4 reply
Yes, I am thinking of drawing tree it self, as it shown in text books.
I hope i can do it with GDI+,..But not sure.
-- modified at 3:23 Tuesday 2nd May, 2006
|
|
|
|
|
You can doo it with GDI+. I was trying to do draw my tree about a week ago, but then I decided to use the TreeView control.
Drawing a tree seems very complex, as nodes would quickly overlap...
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi,
Can U please send me some sort of rough code, so i may modify and make it.
It may help me.
Thank U.
Shiva
|
|
|
|
|
Code that does what?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
|
I think you missunderstood me. I didn't write a program that would manually draw the tree, I just used the TreeView control.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Ok, Sorry i misleaded
Thank U
|
|
|
|
|
Hello,
I am stuck on a Collection class in which my code is apparently overwriting the previous entries whenever an 'Add' is performed. I imagine I am overlooking something or implementing something incorrectly, but I have been unable to locate my problem. Any assistance will be greatly appreciated.
Note that I fealt this was a problem with the instantiation of the item contained within the collection class, but I create a new instantiation within the while loop. Additionally, I have tried this from outside the class and within the class. The class is to determine the email addresses and group names contained within a comma-delimited string of text ( in this case the txt_To.Text ).
The code that I feel to be relevant ( though it may be too much ) is as follows:
Collection Class code:
using System;
using System.IO;
using System.Collections;
namespace Direct_Mailer.Classes
{
public class Address_List : CollectionBase
{
private static string
_Name = null;
public Address_List()
{
}
public Address_List( string Name )
{
_Name = Name;
}
#region Address List Methods
#region Standard Methods
public Address this[ int index ]
{
get
{
return ( Address )List[ index ];
}
set
{
List[ index ] = value;
}
}
public int Add( Address value )
{
try
{
return List.Add( value );
}
catch( Exception this_Exception )
{
throw new Exception( "Add to the Address List failed.", this_Exception );
}
}
public void Insert( int index, Address value )
{
try
{
List.Insert( index, value );
}
catch( Exception this_Exception )
{
throw new Exception( "Insertion into the Address List failed.", this_Exception );
}
}
public void Remove( Address value )
{
try
{
List.Remove( value );
}
catch( Exception this_Exception )
{
throw new Exception( "Removal from the Address List failed.", this_Exception );
}
}
public int IndexOf( Address value )
{
try
{
return List.IndexOf( value );
}
catch( Exception this_Exception )
{
throw new Exception( "Attempt of IndexOf failed in Address List.", this_Exception );
}
}
public void CopyTo( Address[] Address_Array, int index)
{
try
{
List.CopyTo( Address_Array, index );
}
catch( Exception this_Exception )
{
throw new Exception( "The CopyTo method failed in Address List.", this_Exception );
}
}
#endregion
#region Class Specific Methods
public string Name
{
get
{
return _Name;
}
set
{
_Name = value;
}
}
static private Address this_Address = new Address();
public Address_List generate_List( string comma_delim )
{
int begin_pos = 0,
comma_pos = 0,
amp_pos = 0;
try
{
while( comma_pos >= 0 )
{
comma_pos = comma_delim.IndexOf( ',', comma_pos );
if ( comma_pos <= 0 )
this_Address.address = comma_delim.Substring( begin_pos);
else
this_Address.address = comma_delim.Substring( begin_pos, comma_pos - begin_pos );
this_Address.address.Trim();
amp_pos = this_Address.address.IndexOf( '@' );
if ( amp_pos != -1 )
this_Address.type = Address.Type.Address;
else
this_Address.type = Address.Type.Group;
List.Add( this_Address );
if ( comma_pos >= 0 )
begin_pos = amp_pos = ++comma_pos;
}
return this;
}
catch( Exception this_Exception )
{
throw new Exception( "Error occured attempting to generate an Address List.", this_Exception );
}
}
#endregion
#endregion
}
}
From the item class the Collection class contains:
using System;
using System.IO;
namespace Direct_Mailer.Classes
{
public class Address
{
public Address()
{
}
public enum Type
{ Address, Group };
private static string
_address = null;
public string address
{
get
{
return _address;
}
set
{
_address = value;
}
}
private static Type _type = 0;
public Type type
{
get
{
return _type;
}
set
{
_type = value;
}
}
}
}
From the function on the form that accesses the collection:
private void btn_Send_Click(object sender, System.EventArgs e)
{
Address_List To_List = new Address_List();
if ( txt_To.Text.Length <= 0 )
{
MessageBox.Show("This email has not been addressed to anyone", "Direct Mailer", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
txt_To.BackColor = Color.LightCoral;
return;
}
To_List.generate_List( txt_To.Text );
txt_Body.Text = "Listing produced the following:";
for ( int counter = 0; counter < To_List.Count; counter++ )
{
txt_Body.Text += "\n\t" + To_List[ counter ].address
+ "\t" + To_List[ counter ].type.ToString();
}
}
Far better to keep one's mouth shut
_ and appear stupid
than to open one's mouth
_ and remove all doubt.
I rarely follow this.
|
|
|
|