2426810	2426759	is there a way to capture database messages that a script generates while using SqlCommand?	SqlConnection.InfoMessage	0
16774305	16774261	C# - Read a nvarchar (dd/MM/yyyy) into a dateTimePicker	dateTimePicker.Value = DateTime.Parse(reader["Date"].ToString());	0
10705134	10704284	How Do I Change the Size Of A PrintDialog Form	foreach (string s in PrinterSettings.InstalledPrinters)\n{\n    comboBox1.Items.Add(s);\n}	0
3263482	3263407	subscribe to IE process	System.Diagnostics.Process.GetProcesses();	0
5889330	5889197	MongoDB/C# get all values of a certain key in all documents	var collection = _db.GetCollection("employees");\nreturn (from p in collection.AsQueryable()\n         select p["FullName"]).toList();	0
13771298	13769081	Asynchronous insert in Azure Table	context.BeginSaveChangesWithRetries(SaveChangesOptions.Batch,\n    (asyncResult => context.EndSaveChangesWithRetries(asyncResult)),\n    null);	0
10626960	10626905	Linq to group by firstname lastname and select from a sub array	var result = from c in contacts\n                 group c by new { c.firstname, c.lastname } into g\n                 select g.ToList();\n\n    var result1 = from c in companyList.SelectMany(company => company.Contacts)\n                  group c by new { c.firstname, c.lastname } into g\n                  select g.ToList();	0
3334289	3334229	How do i get the top 5 items in a database based on the occurence of a particluar field?	IEnumerable<int> top3ProductIds = (from btp in entities.BasketToProduct\n                                   group btp by btp.ProductId into g\n                                   orderby g.Count() descending\n                                   select g.Key).Take(3);	0
11732317	11504721	C# Window Form Application: Is there a way to convert pdf into bitmap without using any third party library?	static void Main(string[] args)\n    {\n        // Create an instance of Bytescout.PDFRenderer.RasterRenderer object and register it.\n        RasterRenderer renderer = new RasterRenderer();\n        renderer.RegistrationName = "demo";\n        renderer.RegistrationKey = "demo";\n\n        // Load PDF document.\n        renderer.LoadDocumentFromFile("multipage.pdf");\n\n        for (int i = 0; i < renderer.GetPageCount(); i++)\n        {\n            // Render first page of the document to BMP image file.\n            renderer.RenderPageToFile(i, RasterOutputFormat.BMP, "image" + i + ".bmp");\n        }\n\n        // Open the first output file in default image viewer.\n        System.Diagnostics.Process.Start("image0.bmp");\n    }	0
22132965	22132901	How to convert an array of string to a sentence?	var temp = words.Aggregate((x, y) => x + " " + y);	0
30320979	30318206	Bulk update column in Data Table based on another column	dt.Columns.Add("MyDate", GetType(Date)).Expression = "SUBSTRING(strDateField,5,2)+'/'+SUBSTRING(strDateField,7,2)+'/'+SUBSTRING(strDateField,1,4)";	0
10183500	10183441	Counting how many objects are being used from a class	public class C\n{\n  private static int numInstances;\n  public C() {\n    ++numInstances;\n    // and whatever else is needed\n  }\n}	0
16314032	16313062	How to read a special character from rtf file using C#?	\rdblquote  0xD3	0
12200405	12199600	How do I get the last part of this filepath?	class Program\n{\n    static void Main(string[] args)\n    {\n        Console.WriteLine(ExtractPath(@"C:\Temp\X\2012\08\27\18\35\wy32dm1q.qyt"));\n        Console.WriteLine(ExtractPath(@"D:\Temp\X\Y\2012\08\27\18\36\tx84uwvr.puq"));\n    }\n\n    static string ExtractPath(string fullPath)\n    {\n        string regexconvention = String.Format(@"\d{{4}}\u{0:X4}(\d{{2}}\u{0:X4}){{4}}\w{{8}}.\w{{3}}", Convert.ToInt32(Path.DirectorySeparatorChar, CultureInfo.InvariantCulture));\n\n        return Regex.Match(fullPath, regexconvention).Value;\n    }\n}	0
5622233	5622166	How can I retrieve a List of entities from a many to many relationship?	return db.GradeParaleloes.Single(g => g.GradeParaleloId == gradeParaleloId)\n                         .GradeStudents.Select(s => s.Student).ToList();	0
10602280	10602064	How do I open Microsoft Word and display a specific .doc containing a mail-merge by using Visual C# Express?	var type = Type.GetTypeFromProgID("Word.Application");\ndynamic word = Activator.CreateInstance(type);\nword.Visible = true;\nword.Documents.Open(@"C:\test.docx");	0
18864333	18864209	How can I compare two different fields in two collections?	bool RfcEqualsAfd=rfc.All(q=>\n                         afd.Any(a=>\n                                q.Response==a.Correct && \n                                q.AnswerId==a.AnswerId\n                                )\n                         );	0
22895164	22895074	How clear two RichTextBox using CheckedListBox and button	private void button1_Click(object sender, EventArgs e)\n        {\n\n            for (int i = 0; i < checkedListBox1.Items.Count; i++)\n            {\n                if (checkedListBox1.GetItemChecked(i))\n                {\n                    string str = (string)checkedListBox1.Items[i];\n                    if(str ==  "rtb1")\n                    {\n                      richTextBox1.Clear();\n                      richTextBox1.Focus();\n                    }\n                     if(str ==  "rtb2")\n                    {\n                       richTextBox2.Clear();\n                       richTextBox2.Focus();\n                    }\n                }\n            }	0
20314510	20314499	How to remove all spaces before and after a string in C#	string str = "     hello world        ";\nstr=str.Trim();	0
8586869	4902461	ConfigurationElementCollection with a number of ConfigurationElements of different type	Microsoft.Practices.EnterpriseLibrary.Common.Configuration.PolymorphicConfigurationElementCollection<T>	0
31916355	31916153	C# Display compare timestamp to current month	public static DateTime ParseUnixDateTime(double unixTime)\n    {\n        var dt= new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);\n        dt= dt.AddSeconds(unixTimeStamp).ToLocalTime();\n        return dt;\n    }	0
11911380	11911359	dividing a string array in groups	var res = longWord\n    .Split(' ').\n    .Select((s, i) => new { Str = s, Index = i })\n    .GroupBy(p => p.Index / 10)\n    .Select(g => string.Join(" ", g.Select(v => v.Str)));	0
3047629	3047448	Accessing "current class" from WPF custom MarkupExtension	public override object ProvideValue(IServiceProvider serviceProvider)\n{\n    var rootObjectProvider = serviceProvider.GetService(typeof(IRootObjectProvider)) as IRootObjectProvider;\n    var root = rootObjectProvider.RootObject;\n    // do whatever you need to do here\n}	0
14289387	14289313	How can I programmatically extract the app name and version number?	var xmlReaderSettings = new XmlReaderSettings\n{\n    XmlResolver = new XmlXapResolver()\n};\n\nusing (var xmlReader = XmlReader.Create("WMAppManifest.xml", xmlReaderSettings))\n{\n    xmlReader.ReadToDescendant("App");\n\n    var AppName = xmlReader.GetAttribute("Title");\n    var AppVersion = xmlReader.GetAttribute("Version");\n}	0
25015979	25015791	how to get the current gps coordinates in xamarin	CLLocationManager lm = new CLLocationManager(); //changed the class name\n... (Acurray)\n... (Other Specs)\n\nlm.LocationsUpdated += delegate(object sender, CLLocationsUpdatedEventArgs e) {\n    foreach(CLLocation l in e.Locations) {\n        Console.WriteLine(l.Coordinate.Latitude.ToString() + ", " +l.Coordinate.Longitude.ToString());\n    }\n};\n\nlm.StartUpdatingLocation();	0
11325234	11325028	Extract strings from file and save in another using c#	private void extract_lines(string filein, string fileout)\n    {\n        using (StreamReader reader = new StreamReader(filein))\n        {\n            using (StreamWriter writer = new StreamWriter(fileout))\n            {\n                string line;\n                while ((line = reader.ReadLine()) != null)\n                {\n                    if (line.Contains("what you looking for"))\n                    {\n                        writer.Write(line);\n                    }\n                }\n            }\n        }\n    }	0
30606697	30606620	Store Text to String[] Arrays?	string[] lines = System.IO.File.ReadAllLines(@"F:\Designe- Video\projects\Phpgonehelp\Phpgonehelp\PHPCODE\Php1.txt");	0
1715666	1715653	extract info from a string	string xml = "<foo>" + foo + "</foo>";	0
6166141	6148639	How to open Outlook new mail window c#	Outlook.Application oApp    = new Outlook.Application ();\nOutlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem ( Outlook.OlItemType.olMailItem );\noMailItem.To    = address;\n// body, bcc etc...\noMailItem.Display ( true );	0
4248962	4248930	how can i get one value to another on user click?	textbox2.Text = textbox.Text;	0
16277053	16265102	XNA: Orthographic window resizing without stretching	Projection = Matrix.CreateOrthographicOffCenter(\n    0.0f, _graphics.Viewport.Width,\n    _graphics.Viewport.Height, 0.0f,\n    -1.0f, 1.0f);	0
9536157	9501560	Run process under current user	ProcessAsUser.Launch("program name");	0
23929735	23929653	how to submit html form from behind code in c sharp	Response.Redirect("pathtomyhtmlpage.html");	0
16226580	16226229	Appending Date to the end of line in multiple textbox	dataTextView.Rows.Add(txtAddText.Text, DateTime.Now.ToShortTimeString());	0
6888051	6885477	Using Autofac to inject log4net into controller	ContainerBuilder builder = new ContainerBuilder();\nbuilder.RegisterControllers(typeof (MvcApplication).Assembly) ;\nbuilder.RegisterModule(new LogInjectionModule());\n\nvar container = builder.Build() ;\nDependencyResolver.SetResolver(new AutofacDependencyResolver(container));	0
25673585	25593771	Telerik, how to preserve a custom colorization when disabling a control?	class Plexiglass : Control\n{\n    protected override void OnPaint(PaintEventArgs e)\n    {\n        if (Parent != null)\n        {\n            Bitmap plexiCover = new Bitmap(Parent.Width, Parent.Height);\n            foreach (Control c in Parent.Controls)\n                if (c.Bounds.IntersectsWith(this.Bounds) & c != this)\n                    c.DrawToBitmap(plexiCover, c.Bounds);\n            e.Graphics.DrawImage(plexiCover, -Left, -Top);\n            plexiCover.Dispose();\n        }\n        e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(128, 0, 0, 0)), Bounds);\n    }\n}	0
22593024	22592997	How to get dataset from Getpaged?	bvl2 = bvs.GetPaged(" Date = '" + Today + "' AND UserId = " + SpecUserID + "", null, 0, 1000, out x).ToDataSet(false);	0
23809252	23809189	How to change a string to an int using Convert.ToSingle() in C#	int.Parse(ageMonth)	0
1195910	1195896	ThreadStart with parameters	Thread t = new Thread (new ParameterizedThreadStart(myMethod));\nt.Start (myParameterObject);	0
17092840	17092632	Saving values of a table output from stored procedure in a list	foreach (DataRow r in ds.Tables[0].Rows)\n{\n   for(int x = 0; x < r.ItemArray.Length; x++)\n       Console.WriteLine(r.ItemArray[x].ToString());\n   Console.WriteLine();    \n}	0
6580869	6580765	C# listbox continuous loop	BackgroundWorker worker = sender as BackgroundWorker;\nbool go = true;\nwhile(go)\n{\n    for (int i = listBox1.Items.Count - 1; i >= 0; i--)\n    {\n        {\n            if (worker.CancellationPending == true)\n            {\n                e.Cancel = true;\n                go = false;\n                break;\n            }\n            else\n            {\n                string queryhere = listBox1.Items[i].ToString();\n                this.SetTextappend("" + queryhere + "\n");\n                System.Threading.Thread.Sleep(500);\n                worker.ReportProgress(i * 1);\n            }\n        }\n    }\n}	0
6223662	6223570	Creation of Marquee in .NET windows application	private int xPos=0;\n\n        public Form1()\n        {\n            InitializeComponent();\n        }\n\n        private void timer1_Tick(object sender, EventArgs e)\n        {\n            if (this.Width == xPos)\n            {\n                //repeat marquee\n                this.lblMarquee.Location = new System.Drawing.Point(0, 40);\n                xPos = 0;\n            }\n            else\n            {\n                this.lblMarquee.Location = new System.Drawing.Point(xPos, 40);\n                xPos++;\n            }\n        }\n\n        private void Form1_Load(object sender, EventArgs e)\n        {\n            timer1.Start();\n        }	0
221209	221154	How can I Convert a Big decimal number to Hex in C# (Eg : 588063595292424954445828)	static string ConvertToHex(decimal d)\n{\n    int[] bits = decimal.GetBits(d);\n    if (bits[3] != 0) // Sign and exponent\n    {\n        throw new ArgumentException();\n    }\n    return string.Format("{0:x8}{1:x8}{2:x8}",\n        (uint)bits[2], (uint)bits[1], (uint)bits[0]);\n}	0
3989727	3989638	Best way to access a SQL Server database using C# .Net	// assuming a "Product" table, which has an entity pluralized to "Products"\n\nMyEntities db = new MyEntities();\n\nvar cheapProducts = db.Products.Where(p => p.Price > 30); // var is IEnumerable<Product>	0
8760492	8760263	How to release anonymous event hander resource?	EventHandler handler = null;\nhandler = (s, e) => \n{    \n    //......                 \n    vm.Loaded -= handler;\n};	0
27161416	27161381	Iteratively add values from C# configuration file to drop down box	var maxIndex = ConfigurationManager.AppSettings.AllKeys\n                 .ToList()\n                 .Where(k => k.StartsWith("confname"))\n                 .Count();\n\nfor (var index = 1; index <= maxIndex; index++)\n{\n  cbxConfig.Items.Add(ConfigurationManager.AppSettings["confname{0}", index])\n}	0
25012357	25012262	Enum values to string list with filter	return\n    Enum.GetValues( typeof(AnimalCodeType) ).\n    Cast<AnimalCodeType>().\n    Where( v => (int)v > 0 ).\n    Select( v => v.ToString() ).\n    ToList();	0
30163227	30163147	Json passing multiple objects	List<Weapon> weapons = new List<Weapon>();\nforeach(var weapon in database.weapons)\n{\n    weapons.add(new Weapon \n                    { \n                        // initialise from db fields \n                    });\n}  \nws = JsonConvert.SerializeObject(weapons);	0
11706719	11706652	Select value in multi-column ListView	listViewResultados.SelectedItem	0
1908612	1908494	c# - combine 2 statements in a catch block into one	catch (MyCustomException)\n{\n   throw;\n}\ncatch (Exception ex)\n{\n   throw new MyCustomException(ex);\n}	0
12428413	12428049	How to query a XmlDocument without using LINQ	System.Xml.XmlNodeList MSPressBookList = xmldoc.SelectNodes("//Publisher[. = 'MSPress']/parent::node()/Title");	0
18085592	18085140	Switching Panels via Index Methods	void uc_ButtonClicked(object sender, EventArgs e) {\n  UserControl1 uc = sender as UserControl1;\n  if (uc != null) {\n    int childIndex = flowLayoutPanel1.Controls.GetChildIndex(uc);\n    if (childIndex > 0) {\n      UserControl1 ucTop = flowLayoutPanel1.Controls[0] as UserControl1;\n      flowLayoutPanel1.Controls.SetChildIndex(uc, 0);\n      flowLayoutPanel1.Controls.SetChildIndex(ucTop, childIndex);\n    }\n  }\n}	0
2884878	2884873	LINQ Query to filter DTO	masterList.Where(c => !excludeItem.Contains(c.customField));	0
21084917	21084821	How to arrange Buttons in Circular shape in wpf using c# code?	Point cntr = new Point(this.Width/2, this.Height/2); // cntr Points Center of Circle\n// Count gives Number of Buttons        \nint count = 25; \n// angle gives angle Between each Button\ndouble angle = 360/(double)count; \nint radius = 150; // Circle's Radius\nfor (int i = 0; i < count; i++)\n{\n    Button button = new Button();\n    button.Text = "Button " + i;\n    button.Location = new Point((int)(cntr.X + radius * Math.Cos((angle * i) * Math.PI / 180)),\n        (int)(cntr.Y + radius * Math.Sin((angle * i) * Math.PI / 180)));\n    this.Panle1.Controls.Add(button);\n}	0
3645652	3645643	c# how to deal with events for multi dynamic created buttons	for (int i = 0; i < 10; i++)\n{\n    var btn = new Button();\n    btn.Text = "Button " + i;\n    btn.Location = new Point(10, 30 * (i + 1) - 16);\n    btn.Click += (sender, args) =>\n    {\n        // sender is the instance of the button that was clicked\n        MessageBox.Show(((Button)sender).Text + " was clicked");\n    };\n    Controls.Add(btn);\n}	0
2557662	2557598	How can I make a fixed hex editor?	int fd = open("test.dat", O_RDWR);\noff_t offset = lseek(fd, 200, SEEK_SET);\nif (off_t == -1) {\n    printf("Boom!\n");\n    exit(1);\n}    \nchar buf[1024];\nssize_t bytes_read = read(fd, buf, 1024);\noffset = lseek(fd, 100, SEEK_SET);\nssize_t bytes_written = write(fd, buf, 1024);\nflush(fd);\nclose(fd);	0
8659717	8658947	Looping through an XML document and assigning data in C# variables	XDocument xdoc = XDocument.Parse(@"<sitecollection name=""collectionName"">\n    <site name=""sitename"">\n    <maingroup name=""maingroupname""> \n    <group name=""groupname""> </group>\n    </maingroup> \n    </site>\n    </sitecollection>\n    ");	0
670603	670570	Class in the BCL that will event at a given DateTime?	public void StartTimer(DateTime target) {\n  double msec = (target - DateTime.Now).TotalMilliseconds;\n  if (msec <= 0 || msec > int.MaxValue) throw new ArgumentOutOfRangeException();\n  timer1.Interval = (int)msec;\n  timer1.Enabled = true;\n}	0
6130957	6119617	Click a button from another Application, emulating mouse + coords?	PostMessage(mainControlChild, WM_KEYDOWN, (int)Keys.Return, 0);\nPostMessage(mainControlChild, WM_KEYUP, (int)Keys.Return, 0);	0
9289115	9287656	How to deal with null data in controller/view model	public ActionResult Edit(int id)\n{\n    var page = Services.PageService.GetPage(id);\n\n    if(page == null)\n    {\n        return Content("CANNOT FIND PAGE");\n    }\n\n    return View(page);\n}	0
18055487	18054739	How to filter data inside subreport RDLC	string tutorUserName = (e.Parameters["tutorusername"].Values.First()).ToString();\n ReportDataSource rdsTradeDetails = new ReportDataSource("Test_DataSet", report);\n e.DataSources.Add(rdsTradeDetails);	0
6999771	6999296	split huge 40000 page pdf into single pages, itextsharp, outofmemoryexception	iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(new iTextSharp.text.pdf.RandomAccessFileOrArray(@"C:\PDFFile.pdf"), null);	0
24853500	24853376	Before inserting new element in xml check if exists the value	XDocument xml = XDocument.Load("path_to_file");\nstring newCountry = "UAE";\n\nXElement countries = xml.Descendants("Countries").First();\nXElement el = countries.Elements().FirstOrDefault(x => x.Value == newCountry);\nif (el == null)\n{\n    el = new XElement("country");\n    el.Value = newCountry;\n    countries.Add(el);        \n}\n\n//Console.WriteLine(countries.ToString());	0
27105879	27105702	How can I use regex expression to match database and table name given in textbox	var query = @"SELECT * FROM [Database Name].[dbo].[Table Name]";\n var match = Regex.Match(query, @"\[([^\]]+)\]\.\[dbo\]\.\[([^\]]+)\]").Groups;\n var database = match[1].ToString();\n var table = match[2].ToString();\n\n //database = "Database Name"\n //table = "Table Name"	0
9853715	9853467	Update ASP Label inside ASP Datalist	(e.Item.FindControl("lblShowResponses") as Label).Text = "Test";\n(e.Item.FindControl("lblShowResponses") as Label).Visible = true;	0
27461931	27461741	Parsing through innerHTML with HtmlAgilityPack	HtmlNodeCollection nodes = doc.DocumentNode.SelectNodes("//div[@class='result-link']");\nif (nodes != null)\n{\n    foreach (HtmlNode node in nodes)\n    {\n        HtmlNode a = node.SelectSingleNode("a[@href]");\n        if (a != null)\n        {\n            // use  a.Attributes["href"];\n        }\n\n        // etc...\n    }\n}	0
24717969	24717887	How do I populate a 'asp:ListBox' with an array of strings?	lstDSYDepartment.Items.Add("Administration");\nlstDSYDepartment.Items.Add("Imaging Services");\n...	0
4048479	4048459	creating new threads in a loop	foreach (int num in Enumerable.Range(0,5))\n    {\n        int loopnum = num;\n\n        thread = new Thread(() => print(loopnum.ToString())); \n        thread.Start();  \n    }	0
21410278	21410153	Get duplicates from C# List<object>	List<ListItem> entitiesList = new List<ListItem>();\n//some code to fill the list\nvar duplicates = entitiesList.OrderByDescending(e => e.createdon)\n                    .GroupBy(e => e.accountNumber)\n                    .Where(e => e.Count() > 1)\n                    .Select(g => new\n                    {\n                        MostRecent = g.FirstOrDefault(),\n                        Others = g.Skip(1).ToList()\n                    });\n\nforeach (var item in duplicates)\n{\n    ListItem mostRecent = item.MostRecent;\n    List<ListItem> others = item.Others;\n    //do stuff with others\n}	0
25735821	25735796	Ensure a string representing a decimal number has a 0 before the "."	newValue = searchFieldValue1.StartsWith(".")\n               ? "0" + searchFieldValue1\n               : searchFieldValue1;	0
8931565	8931027	Easiest way to create a delegate when the method contains a 'ref' parameter	Delegate methodCall = new Func<MyService.CallResult>(delegate() { return service.DoWork(ref myInput)});\nobject callResult = CallMethod(methodCall, null);	0
6942461	6942071	How to get the path of an embebbed resource?	GetType().Assembly.GetManifestResourceStream("someresourcestringhere")	0
13615327	13614242	VSIX: open browser window	var itemOps = Dte.ItemOperations;\nitemOps.Navigate("http://bing.com");	0
9369573	9369535	How to prompt user to save an automated Excel file	const string fName = @"C:\Test.xls";\n  FileInfo fi = new FileInfo(fName);\n  long sz = fi.Length;\n\n  Response.ClearContent();\n  Response.ContentType = Path.GetExtension(fName);\n  Response.AddHeader("Content-Disposition", string.Format("attachment; filename = {0}",System.IO.Path.GetFileName(fName)));\n  Response.AddHeader("Content-Length", sz.ToString("F0"));\n  Response.TransmitFile(fName);\n  Response.End();	0
14711868	14711685	Download files from sql-server with an specific name using mvc2010	Response.AddHeader("content-disposition", "attachment;filename=" + Path.GetFileName(file.Name));	0
7114637	7114619	C# String.Format with Curly Bracket in string	string.Format("{{ foo: '{0}', bar: '{1}' }}", foo, bar);	0
10304304	10303961	Custom Attribute - get value of underlying enum	public enum NavigationLinks\n{\n    SystemDashboard,\n    TradingDashboard,\n}\n\npublic static class Program\n{\n    private static string ToFriendlyName(string defaultName)\n    {\n        var sb = new StringBuilder(defaultName);\n\n        for (int i = 1; i < sb.Length; ++i)\n            if (char.IsUpper(sb[i]))\n            {\n                sb.Insert(i, ' ');\n                ++i;\n            }\n\n        return sb.ToString();\n    }\n\n    public static void Main(string[] args)\n    {\n        var value = NavigationLinks.SystemDashboard;\n\n        var friendlyName = ToFriendlyName(value.ToString());\n    }\n}	0
1605235	1605231	Accessing value of a non static class in a static class	staticA.AValue = b.BValue	0
19624889	19624731	How to open file that is on desktop	private void ReadFromDesktop(string fileName)\n    {\n        string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);\n        string fullName = System.IO.Path.Combine(desktopPath, fileName);\n        using (StreamReader steamReader = new StreamReader(fullName))\n        {\n            string content = steamReader.ReadToEnd();\n        }\n    }	0
4581058	4581022	How do I save settings in C#	RegistryKey currentUser = Registry.CurrentUser;\nRegistryKey subKey = currentUser.CreateSubKey("MyTest", RegistryKeyPermissionCheck.ReadWriteSubTree);\nsubKey.SetValue("WindowHeight", 1024);\nsubKey.SetValue("WindowWidth", 1024);	0
21026039	21025021	Dynamically adding TextBlock using C# in Windows store App	TextBlock colorText = new TextBlock();\ncolortext.Foreground= new SolidColorBrush(Colors.Yellow);\n\nthis.Panel.Children.Add(colortext)	0
12872616	12872596	How can i debug a program written in c# without VS	System.Reflection.MethodBase.GetCurrentMethod().Name	0
2077791	2038730	Sending keystrokes from a C# application to a Java application - strange behaviour?	private void SendKeysToWindow(string WindowName, string KeysToSend)\n    { \n        IntPtr hWnd = FindWindow(null, WindowName);            \n        ShowWindow(hWnd, SW_SHOWNORMAL);\n        SetForegroundWindow(hWnd);\n        Thread.Sleep(50);\n        SendKeys.SendWait(KeysToSend);           \n    }	0
9938582	9938524	Querying Datatable with where condtion	var res = from row in myDTable.AsEnumerable()\nwhere row.Field<int>("EmpID") == 5 &&\n(row.Field<string>("EmpName") != "abc" ||\nrow.Field<string>("EmpName") != "xyz")\nselect row;	0
6738142	6737976	XML Based Project File	public XDocument NewDocument(string path)\n{\n    var doc =\n        new XDocument(\n            new XElement(\n                "Project",\n                new XAttribute("version", "1.0"),\n                new XAttribute("authorname", "user"),\n                new XElement("Platform", ".NET"),\n                new XElement("Code", "codefile.xml"),\n                new XElement("Canvas", "canvas.xml")));\n    doc.Save(path);\n    return doc;\n}	0
15429991	15429656	textbox max characters without special characters	private void textBox1_KeyPress(object sender, KeyPressEventArgs e)\n{\n    if(Char.IsNumber(e.KeyChar))\n        if(textBox1.Text.Replace(",", "").Replace(".", "").Length >= 5)\n            e.Handled = true;\n}	0
28573914	28573784	EF6 Getting Count In Single Call	string query = "SELECT *, \n                       (SELECT Count(*) FROM ChildTable c \n                       WHERE c.ParentId = p.Id) as NumberOfVotes\n                FROM ParentTable p";\n\nRowShape[] rows = ctx.Database.SqlQuery<RowShape>(query, new object[] { }).ToArray();	0
3698929	3698885	How to remove non-ASCII word from a string in C#	string input = "AB ?? CD";\nstring result = Regex.Replace(input, "[^\x0d\x0a\x20-\x7e\t]", "");	0
12720436	12718754	How to load all the known Colors with in a Listbox?	KnownColor[] colors  = Enum.GetValues(typeof(KnownColor));\nforeach(KnownColor knowColor in colors)\n{\n  Color color = Color.FromKnownColor(knowColor);\n\n    ListBoxItem listItem = new ListBoxItem();\n    listItem.Content = color.ToString();\n    listItem.Color = color ;\n    listbox1.Items.Add(listItem);\n}	0
18734238	17545064	Changing the view in the library DhtmlX	scheduler.Initialview="viewname";	0
22541659	22541429	Issue on Replacing Text with Index Value in C#	void Main() {\n\n    string text = File.ReadAllText(@"T:\File1.txt");\n    int num = 0;\n\n    text = (Regex.Replace(text, "map", delegate(Match m) {\n        return "map" + num++;\n    }));\n\n    File.WriteAllText(@"T:\File1.txt", text);\n}	0
5326556	5326411	Adding childs to a treenode dynamically in c#	TreeView myTreeView = new TreeView();\nmyTreeView.Nodes.Clear();\nforeach (string parentText in xml.parent)\n{\n   TreeNode parent = new TreeNode();\n   parent.Text = parentText;\n   myTreeView.Nodes.Add(treeNodeDivisions);\n\n   foreach (string childText in xml.child)\n   {\n      TreeNode child = new TreeNode();\n      child.Text = childText;\n      parent.Nodes.Add(child);\n   }\n}	0
13502965	13502616	Fill SQL data from a .sql file downloaded automatically	using System.Net;\n\n//Download\nWebClient Client = new WebClient ();\nClient.DownloadFile("http://ts1.travian.com/map.sql", @"C:\folder\file.sql");\n\n// Read into a file\nvar sqltext = System.IO.File.ReadAllText(@"c:\folder\file.sql");\n// Split the sql statements up\nvar sqlStatements = sqltext.Split(';'); \n\n// Insert\nusing (SqlConnection connection = new SqlConnection(connectionParameters))\n    {   \n        connection.Open();\n        foreach (var sqlStatement in sqlStatements)  \n        {\n            SqlCommand command = new SqlCommand(sqlStatement, connection);\n            command.ExecuteNonQuery();\n        }\n    }	0
6362008	6361986	how get integer only and remove all string in C#	input = Regex.Replace(input, "[^0-9]+", string.Empty);	0
9760751	9759697	Reading a file used by another process	using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))\nusing (var sr = new StreamReader(fs, Encoding.Default)) {\n    // read the stream\n    //...\n}	0
16320655	16320243	setting a value based on another value in a linq query	SomeByte = (byte)(x.SomeField=="test"?1:0)	0
7897886	7897699	reading windows font	using System.Drawing.Text;\n\nInstalledFontCollection myFonts = new InstalledFontCollection();\nforeach (FontFamily ff in myFonts.Families)\n  comboBox1.Items.Add(ff.Name);\n}	0
31256079	31255115	How to input selected characters of password using selenium c# webdriver	//Your password string\nconst string testPassword = "TestPassword";\n//find the id attribute that contains the index of character needs to be input\nstring str= driver.FindElement(By.CssSelector("input[id^='edit-password-challenge']")).GetAttribute("id");\n//find the index of the char\nint index = Convert.ToInt16(Regex.Match(str, "[0-9]+").ToString().Replace("\"", ""));\n//find the char and convert to string so that can be used with SendKeys() method\nstring charToInput = testPassword[index-1].ToString();\n\n//input the password using the SendKeys() method\ndriver.FindElement(By.CssSelector("the selector")).SendKeys(charToInput);	0
7436454	7436400	How to use Split with TryParse?	var myDoubleList = new List<double>();\nforeach(var doubleString in textBox1.Text.Split(' '))\n{\n    double myDouble;\n    if (double.TryParse(doubleString, out myDouble))\n        myDoubleList.Add(myDouble);    \n}	0
6192804	6189782	C# XNA Matrices - Calculate moon rotation around axis with matrices	world = Matrix.CreateScale(size,size,size)\n        * Matrix.CreateTranslation(0,0,0) \n        * Matrix.CreateRotationY(rotation)\n        * Matrix.CreateTranslation(position)\n        * Matrix.CreateRotationY(revolution); \n\nworld *= Matrix.CreateTranslation( parent.getPosition() );	0
24082521	24082445	C# - Detect locked files in a directory	public bool IsFileLocked(string filePath)\n{\n    try\n    {\n        using (File.Open(filePath, FileMode.Open)){}\n    }\n    catch (IOException e)\n    {\n        retturn true;\n    }  \n\n    return false;\n}	0
9455079	9455043	How do i make a class iterable	class csWordSimilarity : IEnumerable<int>\n{\n    private int _var1 = 1;\n    private int _var2 = 1;\n    private int _var3 = 1;\n    private int _var4 = 1;\n\n    public IEnumerator<int> GetEnumerator()\n    {\n        yield return _var1;\n        yield return _var2;\n        yield return _var3;\n        yield return _var4;\n    }\n\n    IEnumerator IEnumerable.GetEnumerator()\n    {\n        return GetEnumerator();\n    }\n}	0
9615999	9615661	Save Headers from datagridview to excel? save as Excel 2007 format (.xlsx)?	dataGridView1.Columns[X].HeaderText	0
11794234	11794146	Convert int to byte as HEX in C#	int num = 45;\nint bcdNum = 16*(num/10)+(num%10);	0
3893711	3893622	Windows 98-style progress bar	using System;\nusing System.Windows.Forms;\nusing System.Runtime.InteropServices;\n\nclass SimpleProgressBar : ProgressBar {\n    protected override void OnHandleCreated(EventArgs e) {\n        base.OnHandleCreated(e);\n        if (Environment.OSVersion.Version.Major >= 6) {\n            SetWindowTheme(this.Handle, "", "");\n        }\n    }\n    [DllImport("uxtheme.dll")]\n    private static extern int SetWindowTheme(IntPtr hWnd, string appname, string idlist);\n}	0
12880048	12880009	How to call a webservice when in localhost	WebRequest.Create	0
21685553	21684773	Pull entire excel row using LinqToExcel	var excel = new ExcelQueryFactory("excelFileName");\nvar firstRow = excel.Worksheet().First();\nvar companyName = firstRow["CompanyName"];	0
16154891	16154809	Given top left and bottom right points, how can I find all points inside a rectangle?	for i = left_edge to right_edge\n    for j = top_edge to bottom_edge\n        add [i, j] to list of points inside rectangle	0
