[Solved] Net Core Framework Versions on IIS

.NET Core is flexible regarding different versions running on the same web server. Publishing an application as self-contained, will allow you to run as many different versions as you would like on the same web server. See .NET Core application publishing overview. Only if you are publishing as framework-dependent would you need that specific .NET … Read more

[Solved] how to remove all tag in c# using regex.replace [closed]

You should never use regex to parse html, you need html parser. Here is an example how you can do it. You need to add this reference in your project: Install-Package HtmlAgilityPack The code: static void Main(string[] args) { string html = @”<!DOCTYPE html> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> <table> <tr> <td>A!!</td> … Read more

[Solved] Encoding.GetEncoding(“Cyrillic”) making all text question marks in .NET

The text was in some sort of Unicode encoding and why it was acting differently then before with ASCII encoded text. So I did this below before the GetEncoding and it works now. if(!txt.IsNormalized(NormalizationForm.FormKD)) { txt= txt.Normalize(NormalizationForm.FormKD); } solved Encoding.GetEncoding(“Cyrillic”) making all text question marks in .NET

[Solved] Booking System Using C# winform [closed]

You’ll need to establish a connection to your database using a SQLConnection object or the appropriate class depending on your database. For instance: bool isReserved; using (SqlConnection connection = new SqlConnection(connectionString) using (SqlCommand command = new SqlCommand(“SELECT isReserved FROM YourTable WHERE BookingId = 1”, connection)) { connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) … Read more

[Solved] How can I add closed tag in xml document?

Document containing unclosed tag is not XML at all. As others suggested in comments, ideally the effort to fix this problem is done by the party that generate the document. Regarding the original question, detecting unclosed tag in general isn’t a trivial task. I would suggest to try HtmlAgilityPack (HAP). It has built in functionality … Read more

[Solved] How to check if an array contains a value stored in a variable

If you want to see if a value is in the array, use Contains function. If you want to check whether arrays are equal use StructuralComparisons.StructuralEqualityComparer. (https://docs.microsoft.com/en-us/dotnet/api/system.collections.structuralcomparisons.structuralequalitycomparer?view=netframework-4.7.2) Code static void Main(string[] args) { int compValue = 5; int[] values0 = { 1, 2, 5, 7, 8 }; void ContainsValue(int[] array, int valueToTest) { bool isContained … Read more

[Solved] string.Substring not working correctly in C#

It’s actually working correctly. There is a leading space on the string and thus the ninth index is the space just before the DU. Consider this diagram: Jun30/13 DU SJ9802 0123456789 You’re starting on the ninth index, and that’s a space . 1 solved string.Substring not working correctly in C#

[Solved] C# if then else issues [closed]

Your braces and try{} catch{} blocks are mismatched. Here is the corrected code: public partial class frmPersonnel : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSubmit_Click(object sender, EventArgs e) { try { DateTime dt1; DateTime dt2; if (txtFirstName.Text == “”) { txtFirstName.BackColor = System.Drawing.Color.Yellow; lblError.Text = “Please enter first name”; … Read more

[Solved] Write xml with c#?

So if I get it correct, you want to append new data to your existing xml. For that you can chose to temporarily store the current xml and and add new data to it using Linq Xml. To do this, now you need to modify your current code with an additional check for xml file … Read more