【发布时间】:2013-01-16 06:19:09
【问题描述】:
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
}
}
}
我收到错误The name 'Response' does not exist in the current context
【问题讨论】:
-
这看起来像一个控制台应用程序。您希望 Response 在这里出现什么?
-
对不起,我忘了写控制台而不是响应