Add new text to label [closed]

You need three things: A button click handler (assuming you are clicking a single button) A class-scoped integer that counts the number of clicks A series or if/else statements or a switch statement with cases that change the action based on the number of your click. Light code sample: private int _btnClickCount = 0; // … Read more

How To Access Two Databases in a Single connection String in C#?

You use two separate connection objects: SqlConnection con1 = new SqlConnection(@”Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\sms.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True”); SqlConnection con2 = new SqlConnection(@”Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\sms2.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True”);

Get Substring – everything before and after certain characters [closed]

You could use regular expressions, e.g: class Program { static void Main(string[] args) { var input = ” SUCCESS Post Policy Success INVOICE No. :: WS1704003404 || Policy No :: 59203313 || App No. :: 123456724 “; var pattern = @”::\s*(\w+)\s*”; var matches = Regex.Matches(input, pattern); foreach (Match match in matches) Console.WriteLine(match.Groups[1].Value); } }

How can I round a value in SQL

ROUND documentation on MSDN select [raw] = 555.81, [rounded] = round(555.81, 0), [truncated] = round(555.81, 0, 1) Result: | raw | rounded | truncated | |——–|———|———–| | 555.81 | 556 | 555 | SQL Fiddle: http://sqlfiddle.com/#!6/9eecb7db59d16c80417c72d1/5290