Posts

RETURN JSON FROM SQL SERVER as QUERY RESULT

Get as It is Json Body : select ID,MobileNo,FullName,EmailID,DistrictName,TalukaName,VillageName from UserRegistrations  For JSON PATH With Root Json Body :  select ID,MobileNo,FullName,EmailID,DistrictName,TalukaName,VillageName from UserRegistrations  For JSON PATH , ROOT('UserData')  C# Code To Read : public class data { public DateTime date {get;set;} public string name {get;set;} public int numbers {get;set;} } public ActionResult GetAllSummary() { string connectionString ="Data Source=...;Initial Catalog=...;Integrated Security=True"; string query = "SELECT DISTINCT v.date, v.name, v.numbers FROM view as v ORDER BY v.date,v.name,v.numbers"; using(SqlConnection conn = new SqlConnection(connectionString)) { SqlCommand command = new SqlCommand(query, conn); try { conn.Open(); SqlDataReader reader = command.ExecuteReader(); // In this part below, I want the SqlDataReader to ...

Difference Between RenderPartial and RenderAction in Asp.Net MVC

RenderPartial and RenderAction are two methods in the ASP.NET MVC (Model-View-Controller) framework that allow you to include partial views or action results in a view. A partial view is a reusable component that can be rendered inside a view or layout page. It is typically used to display a piece of reusable UI, such as a login form or a shopping cart summary. Partial views are defined as regular views, but they are not associated with a layout page and cannot be called directly by a URL. RenderPartial is a method of the HtmlHelper class that allows you to include a partial view in a view or layout page. It takes the name of the partial view as an argument and returns an MvcHtmlString object that represents the rendered partial view.   RenderAction is a method of the Controller class that allows you to execute an action method and include the action result in a view or layout page. It takes the name of the action method and the name of the controller as arguments and re...

HTTP Status Codes

  1.xxs:  Information 2.xxs:  Success 3.xxs:  Redirection 4.xxs:  Client error 5.xxs:  Server error

Creating Cron Job using WGET , Running URL on Task Schedular

1.Download Wget Tool using below url : https://eternallybored.org/misc/wget/ and download latest available tool 2.copy wget.exe to C:\Windows\System32 3.Open Task Schedular in Windows 4.Create Action  and under Action enter below things Program/Script : Wget Argument : --append-output=C:\Wget\page.txt https://www.abcd.com/page.aspx

How do I find a stored procedure containing ?

Option 1 : SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%Foo%' AND ROUTINE_TYPE = 'PROCEDURE' Option 2 : SELECT OBJECT_NAME(id) FROM SYSCOMMENTS WHERE [text] LIKE '%Foo%' AND OBJECTPROPERTY(id, 'IsProcedure' ) = 1 GROUP BY OBJECT_NAME(id) Option 3 : SELECT OBJECT_NAME(object_id) FROM sys.sql_modules WHERE OBJECTPROPERTY(object_id, 'IsProcedure' ) = 1 AND definition LIKE '%Foo%'