|
ok, I got it to work. I did away with :
GlobalVar globalVar = new GlobalVar;
And change the code from globalVar to GlobalVar.
It compiles but have other problems that need fixed before I can see if it diplays the suits correctly, thanks..
|
|
|
|
|
You should perhaps use an online VB to C# converter to fix all this, or just buy a C# book and read it. This is half C# and half VB
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The online converter @ http://www.developerfusion.com/tools/convert/vb-to-csharp/ gave me that code
|
|
|
|
|
Really ? Then it sucks, I guess you need to buy a C# book and do it yourself, or buy a converter, the commercial ones do a much better job.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Not a huge deal..I have the code from VB, I just need to learn how to do e the same or better with C#. I have a C# book, but no book I've ever seen tells you everything. This is an on-line class, so help is minimal. It is also my last class for my BA-CS, as a Network/Server administrator I do little programming so buying software to do this one project doesn't make much sense.
|
|
|
|
|
yogi_bear_79 wrote: I have a C# book, but no book I've ever seen tells you everything.
Most books will tell you how to define variables, however
One thing you could do, is download some C# projects from code project, and just look at the code to get a feel for how it looks different, things like
int i = 0;
instead of
dim int as i = 0
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I agree, and I have the book and the net for that. This wasn't so much how to type the syntax as the proper useage for what I wanted. I basically came full circle here. public const string is what I started out with, just wasn't working.
|
|
|
|
|
I see Luc helped you, but also, why not use an enumeration?
|
|
|
|
|
Seeing only one constant, I was going to suggest no such thing.
It could become a reply in a future thread though.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Not having the heart to club him, I figured I'd call a spade a spade.
|
|
|
|
|
There is no way I could trump that.
FYI: the suite you call diamonds, has two names in Dutch; the official one would translate to window glass, the more popular one to cookies.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
You guys really suit each other.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
You want a cookie too?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
if not a joker.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I do acutally have one for each suit, if that matters on your suggetions. I do have it working however.
|
|
|
|
|
as the four suits are mutually exclusive it would make sense to use a 4-way enum, which works the same in C# as in VB.NET
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
hi
when datagridview is bind with table. how can i add a row to datagridview
when i try to all. it exception raises that "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound."
|
|
|
|
|
You add it to whatever the datasource is, not the grid.
|
|
|
|
|
I am debugging C# code that utilizes the Websphere MQ Client 5.3. I have the client installed on my PC and Im running under a local account. when the code gets to where I'm initializing the MQManager I get the following:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Here is the code that is bombing:
MQEnvironment.Hostname = HostName;
MQEnvironment.Channel = Channel;
MQEnvironment.Port = Port;
mqQMgr = new MQQueueManager(QueueManager);
Source: amqmdnet
Stacktrace: at IBM.WMQ.MQClient.MQCONNX(String qMgrName, MQCNO& mqcno, Int32& pHconn, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.MQClientConnector.MQCONNX(String qMgrName, MQCNO& mqcno, Int32& pHconn, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)
at IBM.WMQ.MQQueueManager..ctor(String queueManagerName)
at FillTek.EAI.Avon.MarkMQOrderProcessor.MessageProcessor..ctor(String HostName, String Channel, Int32 Port, String QueueManager, String QueueName) in C:\Projects\2008 Projects\AvonManager.root\AvonManager\MarkMQOrderProcessor\MessageProcessor.cs:line 121
at MarkMQOrderProcessorApp.Processor.Main(String[] args) in C:\Projects\2008 Projects\AvonManager.root\AvonManager\MarkMQOrderProcessorApp\Processor.cs:line 24
Any help would be greatly appreciated!
JeanieB
|
|
|
|
|
Looks like a bug in WMQ to me
|
|
|
|
|
Thanks so much for the response. I figured out what the issues was. The entire PC needed to be re-imaged. The registry along with the GAC was total fried. Rather than going thru one by one and figuring out what dlls need register I found it easier to just re image the PC. But thanks again!
JeanieB
|
|
|
|
|
Hi
i want to change connection string that saved in app.config (which created in visual studio wizard dialog).
i changed some Settings.Designer.cs code which described in this thread[^] to make that editable. that's works good when i change it at runTime and load it again, but when i exit from my app and look at my saved properties, it's again backed to earlier settings (before my edit).
what's the problem and how to solve this ?
thanks
|
|
|
|
|
Could you share the code snippets…So that we can get the actual scenario properly?
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
here is my Settings.Designer.cs code (my modification code is bold) :
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
public string mehrConnectionString {
get {
return ((string)(this["mehrConnectionString"]));
}
set
{
this["mehrConnectionString"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
public string mehrConnectionString1 {
get {
return ((string)(this["mehrConnectionString1"]));
}
set
{
this["mehrConnectionString1"] = value;
}
}
here is my code to save in app.config :
Properties.Settings.Default.serverName = this.txtServer.Text;
Properties.Settings.Default.userName = this.txtUser.Text;
Properties.Settings.Default.password = this.txtPass.Text;
if (this.radioLocal.Checked)
{
Properties.Settings.Default.network = false;
Properties.Settings.Default.mehrConnectionString = string.Format("Data Source={0};Initial Catalog=mehr;Integrated Security=True", this.txtServer.Text);
Properties.Settings.Default.mehrConnectionString1 = string.Format("Data Source={0};Initial Catalog=mehr;Integrated Security=True", this.txtServer.Text);
}
else
{
Properties.Settings.Default.network = true;
Properties.Settings.Default.mehrConnectionString = string.Format("Data Source={0};Initial Catalog=mehr;User Id={1};Password={2};", this.txtServer.Text, this.txtUser.Text, this.txtPass.Text);
Properties.Settings.Default.mehrConnectionString1 = string.Format("Data Source={0};Initial Catalog=mehr;User Id={1};Password={2};", this.txtServer.Text, this.txtUser.Text, this.txtPass.Text);
}
Properties.Settings.Default.Save();
regards
|
|
|
|