using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using System.Web;
namespace Database_Updation
{
class Program
{
static void Main(string[] args)
{
SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyDbConn1"].ToString());
SqlCommand cmd = new SqlCommand("SELECT [GUID] FROM [Source].[dbo].[Source_User]", cn);
cn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
rdr.Read();
Response.Write(rdr[0].ToString()); //read a value
}
}
}
I am getting error The name 'Response' does not exist in the current context
From you code it is console application than dont use response use and also check datareader having data
Response is the object use in Web application, you will get this object in asp.net web application if you like to do so create web applciation not console application… you need to read difference between console and web asp.net application