这是我的代码:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=OCS-MXL930055N\\;Initial Catalog=sample;Integrated Security=True";
SqlCommand cmd = new SqlCommand
con.Open("Select * from ShoppingList", con);
con.Close("Select * from ShoppingList", con);
}
}
这些是我遇到的问题:
con.Open("Select * from ShoppingList", con)();
con.Close("Select * from ShoppingList", con)();
他们的意思有什么帮助吗?我不太确定我做错了什么。