|
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.ReadLine();
}
}
}
|
|
|
|
|
|
open the command prompt and run the app from there ...
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
I created a dll in .NET converted it with the TlbExp.exe to a .tlb file and I imported that file in a C++ application in which I wish to use it.
The strange thing is that for some reason the namespace in the tlb file does not seem to be correct...
The .NET dll project is called myNETDLL and creates the myNETDLL.dll file. The namespace of the class and interface I wish to export is COMCaller (I changed the default namespace in the property settings of the project too).
Now creating the tlb file goes fine, the thing is that when I import the tlb in my C++ project the myNETDLL.tlh (created when compiling the C++ project) has all the exported functions and classes in a namespace called myNETDLL and there is no mention whatsoever about any COMCaller namespace. Does anyone know what I might be doing wrong? Can^t I have a namespace with a different name than the project name when I plan to make a type library of it?
Thanks for any feedback you provide,
Davy
|
|
|
|
|
I'm trying to access a web address using proxy (Microsoft ISA Server).
The authentication is NTLM (using domain in Windows 2000).
My code is :
try
{
const string proxyHostAndPort = "http://myproxy:8080";
WebProxy webProxy = new WebProxy(proxyHostAndPort, true);
webProxy.Credentials = CredentialCache.DefaultCredentials;
WebRequest webRequest = WebRequest.Create("http://www.microsoft.com");
webRequest.Credentials = CredentialCache.DefaultCredentials;
webRequest.Proxy = webProxy;
WebResponse webResponse = webRequest.GetResponse();
Stream stream = webResponse.GetResponseStream();
byte[] receivedDataInBytes = new byte[webResponse.ContentLength];
stream.Read(receivedDataInBytes, 0, receivedDataInBytes.Length);
string receivedDataInString = Encoding.ASCII.GetString(receivedDataInBytes);
Trace.WriteLine(receivedDataInString);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
But I get an error (407 - Proxy authentication needed). Are there something wrong in my code ?
Thanks.
|
|
|
|
|
Hello,
Can i disabled the entries in ComboBox in window application ??
What i want is as follows
I have two ComboBox on my page having same entries in it. If i Select one of the value from first ComboBox then that value or entry get automatically diable in second ComboBox and vice versa.
Thanx in Adv.
|
|
|
|
|
hi ankushmn!
I suggest that you just remove it from the list instead of disabling it.
I also recommend to use a DataView as your DataSource instead of using Items.Add when populating the combobox.
you can use the RowFilter of the combobox to remove the item you want and put this handling on the SelectedIndexChanged event handler of your two comboboxes.
hope that helps!
microsoc
|
|
|
|
|
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
|
|
|
|