|
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
|
|
|
|
|
Probably you are loading the app.config several times, why dont you use a Hashtable for managing multiple connectionstring
Example:
Hashtable ObjHashtable = new Hashtable();
ObjHashtable.Add("Key1", "Data Source= source_1 ;Initial Catalog= DatabaseName_1;User ID=id;Password=pwd;");
ObjHashtable.Add("Key2", "Data Source= source_2 ;Initial Catalog= DatabaseName_2;User ID=id;Password=pwd;");
You just need to load the Hashtable only one time...........
public SqlDataReader Example(string strSql, string strKey)
{
ObjSqlConnection = new SqlConnection(ObjHashtable[strKey].ToString());
...........
.......
}
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.
|
|
|
|
|
Thanks Md. Marufuzzaman
i want to save my connection string in app.config to save this state in future use. next time it must use the saved settings which user set.
|
|
|
|
|
You are most welcome.......
Absolutely you save your connectionString in your app.config.
My point of view was:
1. Read your config file
2. Fill the HasTable
3. Use the HasTable runtime so that you not need to invoke config file several times.
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.
|
|
|
|
|
my problem is that i can't store my settings in app.config file. it's not persistence.
|
|
|
|
|
I am looking into a simular issue and although, I am no expert, I think app.config is used in design time and [appname].exe.config is for release and where the changes need to be made... anyone, please correct me if I'm wrong on this.
All the best
cjoki
|
|
|
|
|
hi
how to use navigator in datagridview
can any one provide me link.
thanks
|
|
|
|