Formatting ToShortDateString to dd/MM/yyyy

ToShortDateString does not have an overload which takes any parameter. If your ToShortDateString() returns MM/dd/yyyy format, that means your CurrentCulture has this format in it’s ShortDatePattern property. You can always use custom formatting for that like with proper culture like; TextBox2.Text = DateTime.Today.ToString(“dd/MM/yyyy”, CultureInfo.InvariantCulture);

How to map JSON to C# Objects

You can use Json.NET to deserialize your json string as (with some modifications to your classes) var yourObject = JsonConvert.DeserializeObject<Root>(jsonstring); public class Root { public Profile[] Profile; } public class Profile { public string Name { get; set; } public string Last { get; set; } public Client Client { get; set; } public DateTime … Read more

How to pass a variable to the SelectCommand of a SqlDataSource?

Try this instead, remove the SelectCommand property and SelectParameters: <asp:SqlDataSource ID=”SqlDataSource1″ runat=”server” ConnectionString=”<%$ ConnectionStrings:itematConnectionString %>”> Then in the code behind do this: SqlDataSource1.SelectParameters.Add(“userId”, userId.ToString()); SqlDataSource1.SelectCommand = “SELECT items.name, items.id FROM items INNER JOIN users_items ON items.id = users_items.id WHERE (users_items.user_id = @userId) ORDER BY users_items.date DESC” While this worked for me, the following code also … Read more

How to implement TDD in ASP.NET WebForms

Microsoft introduced ASP.NET MVC because they thought they could make money from an untapped market – those who feel that Web Forms are too “heavyweight”, and who are programming using a lighter-weight framework. This includes those who are accustomed to the MVC paradigm. It also includes those who couldn’t figure out how to do unit … Read more

Differences between ASP.NET Web Application (.NET Framework) vs ASP.NET Core Web Application (.NET Framework)

Option 1 – ASP.NET Web Application Option 3 – ASP.NET Core Web Application Although both project templates use Full .Net Framework, Option 1 is for creating projects using legacy version of ASP.NET MVC in which we can use Global.asax. Option 3 is totally new concept in which wwwroot folder, using task runners and everything is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)