我做了一个简单的web应用程序,所有代码都在这里了
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace 网上教务系统
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected DataTable tempTable = new DataTable();
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;
protected System.Data.SqlClient.SqlCommand sqlInsertCommand1;
protected System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
protected System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
protected System.Data.SqlClient.SqlConnection sqlConnection1;
private void Page_Load(object sender, System.EventArgs e)
{
this.sqlDataAdapter1.Fill(this.tempTable);
this.DataGrid1.DataSource = tempTable;
}
}
数据库的连接我是用C#的连接方法,这样不知行不行,我是刚学的,请大家帮帮我
这到底是什么会事呀?