|
Hi
To use transaction construct(as follows) in C#, MSDTC needs to be running on Windows machine. Right?
using (TransactionScope ts = new TransactionScope())
{
using (SharedDbConnectionScope sharedConnectionScope = new SharedDbConnectionScope())
{
// update table 1
// update table 2
// ts.commit here
}
}
1. Is MS-DTC a default service on Windows systems(XP, Vista, Windows 7, Servers etc)?
2. If it is not enabled, how can I make sure it gets enabled during the installation process of my application?
Please advise.
Thanks
AJ
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
You don't need it with the newer versions of SQL server like 2005 or 2008. It is only required if you are using SQL 2000. If you are using Oracle, then you need this service.
Best wishes,
Navaneeth
|
|
|
|
|
Not new to programming, but fairly new to .Net.
I have learned enough about C# to actually start doing something productive, but I am having trouble putting it all together. Most Windows Forms apps start by setting up the environment, opening databases, displaying the desktop, menu, etc. I'm so used to working with code snippets and other pieces of an application, that I don't know how, nor am finding in any resource I have studied, to correctly set up an application.
A picture is worth a thousand words, and would like to ask any members if there are any good, complete, example applications on this site (or anywhere else) that I can use as a springboard? Any help would be appreciated!
|
|
|
|
|
There are plenty of articles that let you download source code
|
|
|
|
|
Try Googling the following string @"open source .net C# Applications"
|
|
|
|
|
I need magic wand c# source code. can any body hep me?
Thanks
|
|
|
|
|
Hi,
I'm not sure anyone should be divulging this information.
See the referenced code of ethics from the IBM Board of Directors [^]
Alan.
|
|
|
|
|
i did not mean copy of magic wand of photshop. I mean, did any body have open source code of similar sctript.
thanks
|
|
|
|
|
I believe Harold Potter wrote an article about this?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hi
I have a question concerning custom ConfigurationValidator, which verifies the entries in the app.config file. Below is the class which represents the section in the config file.
public class SettingSection : ConfigurationSection
{
[ConfigurationProperty("appId", IsKey=true, IsRequired=true), ConfigurationValidator(typeof(AppIdValidator))]
public string AppId
{
get { return (string)base["appId"]; }
}
}
public class AppIdValidator : ConfigurationValidatorBase
{
public override bool CanValidate(Type type)
{
return true;
}
public override void Validate(object value)
{
string val = (string)value;
Regex regex = new Regex(@"\A\d{4}-\d{4}-\d{4}-\d{4}\z");
if (regex.IsMatch(val))
{
return;
}
else
{
throw new FormatException("Input string is not in correct format");
}
}
}
The problem is when the instance of SettingSection is created, and the validator is called, the metod Validate is called with empty string - no metter what is the value in the app.config file. If I set the DefaultValue of the ConfigurationProperty attribute, than the validator is called with that value - again regardless to the entry in app.config.
Any idea will be appreciated
Uros
|
|
|
|
|
Hi guys,
I've implemented the code from http://www.neowin.net/forum/lofiversion/index.php/t180600.html[^] into my project (the latest post). Now I wondered: If I go commercial, is the use of the Windows file copy utility legal? This is of great importance, since almost my entire project depends on this code.
Thanks in advance,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:59am.
|
|
|
|
|
stancrm wrote: I think
I need more certainty than that, but thanks for your reply.
Anyone else knows?
Motivation is the key to software development.
|
|
|
|
|
Zaegra wrote: I've implemented the code from http://www.neowin.net/forum/lofiversion/index.php/t180600.html[^] into my project
If you have implemented code from a different forum, why not ask this question at that forum, as we do not know what their rules are.
|
|
|
|
|
That question is easy to answer: That thread has been abandoned a million years ago, plus, I find the Codeproject a very reliable source of information. That's why I posted the question here, and not there
Motivation is the key to software development.
|
|
|
|
|
Well their site displays no copyright notices apart from for the theme it uses for display. The code is given freely with no copyright notices and is in the public domain so I would say yes - go ahead and use it.
If you want to be absolutely sure, email the site admins to check.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hello! I'm new to C# programming and I have an issue with getting a textbox string to convert to a double.
I'm not sure where I went wrong in the following code, but MS Web Developer isn't liking it:
dEarn = Convert.ToDouble(sEarnings);
dHealth = Convert.ToDouble(txtHealth.Text);
d401k = Convert.ToDouble(txt401k.Text);
I'm trying this two ways: 1) Where "sEarnings" is a string equal to textbox input, and 2) Where I simply try to convert the textbox input directly. Neither way seems to work, and to add clarity, all of this is happening under a Button_Click void.
Thanks!
|
|
|
|
|
Have you looked into using Double.TryParse() instead?
|
|
|
|
|
Tried dEarn = Double.TryParse(sEarnings);... MS Web Developer complains "No overload for method 'TryParse' takes '1' arguments"
|
|
|
|
|
|
Don't use a TextBox for numeric values; use a NumericUpDown.
|
|
|
|
|
This is a project specifically utilizing textbox input. Many tools aren't available to me yet as I am a beginner with C#, though I do have some VB experience. So I don't necessarily know or understand all of the possible ways around an issue.
Basically, think of the most common, elementary way you'd handle this problem and that is likely my answer.
|
|
|
|
|
Double.TryParse and dont forget formatting and the Culture you are addressing
|
|
|
|
|
Thanks, Natza - but I don't understand what you mean by "culture".
Here's what I'm working with, all under a Button_Click void. I've got an ASP page interacting with this back code. The user enters a number string in a textbox, I want to convert that string into a double and do a calculation. I don't want to test the input here for a boolean yes/no, I want to convert the string a use it.
-------------------
protected void btnCalc_Click(object sender, System.EventArgs e)
{
String sName = (txtName.Text);
String sEarnings = (txtEarnings.Text);
String sHealth = (txtHealth.Text);
String s401k = (txt401k.Text);
dEarn = Convert.ToDouble(sEarnings);
dHealth = Convert.ToDouble(txtHealth.Text);
d401k = Convert.ToDouble(txt401k.Text);
<other code,="" etc....="">
}
--------------------------
|
|
|
|
|
I gave you the answer; see my message above.
|
|
|
|