[Solved] C#: How to check all Radio Button’s on forms

Get all RadioButtons and iterate over the list to get the Checked one: foreach (RadioButton rBtn in this.Controls.OfType<RadioButton>()) { if(rBtn.Checked) { label2.Text = “Installation location:'” + rBtn.Text; break; } } 1 solved C#: How to check all Radio Button’s on forms

[Solved] setting the size of array

According to your error messages, you compile with a C++ compiler. Do not! C is not C++ and C++ is not C with classes. They are different languages. As the messages state, C++ does not provide VLAs (see below). Use a standard-compliant C compiler, or at least a C99 compiler. Variable length arrays (VLAs) were … Read more

[Solved] SQL Server with C#

Try This SqlConnection myConnection = new SqlConnection(“Data Source=Igor;Initial Catalog=Prueba;Integrated Security=True”); Edit2: For the Above Picture and for TEST_DB database the Connection String should be written as SqlConnection myConnection = new SqlConnection(“Data Source=AJMOT-PC;User ID=sa;Password=thisismypassword;Initial Catalog=TEST_DB;Integrated Security=True”); If you are using the Window authentication for sql server then you don’t need to declare the User ID=sa;Password=thisismypassword section. … Read more

[Solved] Regex to extract only domain from sub-domains [duplicate]

Just to iterate on Jens’ comment, we have to guess: What is your expected output when additional information appears, e.g. http://therealzenstar.blogspot.fr/somedata.html. Is it still blogspot.fr? Are such examples needed to be adresed? You said you want to replace “everything else” with “”. Replace() will replace everything that is matched with what you want. So, to … Read more

[Solved] Search for a url in a string and remove enclosing tag

The correct answer is use the HTML Agility Pack and parse the html properly However, in regards to you comment I have 13000 sharepoint sites and for each site I have to parse the master page and remove the above specific script tag You can use something nasty like this i guess :/ Regex.Replace(yourPage, @”<script … Read more

[Solved] Why does MSDN documentation show protected methods for Random?

You seem to have several questions about the System.Random documentation. It lists three protected methods, but two of them are inherited from System.Object. The third one is Sample, which is documented to return “a random floating-point number between 0.0 and 1.0.” To answer your title question, no, the MSDN documentation is not incorrect. That method … Read more

[Solved] IF A BLANK SPACE IS PRESENT IN THE COLUMN HEADING …..AND/OR operator not working in sql statement in c# .net for modifying an excel sheet [closed]

I’m pretty sure that the problem is the space in the name of your Faculty Name column and that this has nothing to do with the use of AND or OR. Please try: sql = “Update [Sheet1$] set A1 = ‘a’ ” + “where Designation = ‘Prof(senior)’ and [Faculty Name] = ‘bob'”; 1 solved IF … Read more

[Solved] I want datetimepicker.mindate < datetimepicker1.value [closed]

Your exception is telling you that have to give dateTimePicker1 a value. Also, the order you do things is important. You can’t set dateTimePicker1’s value to less than the MinDate. That’s the purpose of having a MinDate. You must first modify the MinDate, then set the value. dateTimePicker1.MinDate = DateTime.Parse(comboBox3.Text); // -> contains a date … Read more