B
borland.et
Unregistered / Unconfirmed
GUEST, unregistred user!
用记事本这样全局定义OleDbConnection
<Script Language="C#" Runat="Server">
OleDbConnection MyConn;
public void Page_Load(Object src,EventArgs e)
{
//连接语句
string MyConnString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source="+Server.MapPath(".")+"..//DataBase//db1.mdb;";
MyConn = new OleDbConnection(MyConnString);
MyConn.Open();
在VS.NET中我想全局申明OleDbConnection:(当然,现在MyConn无法用,没有申明)
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid score;
private void Page_Load(object sender, System.EventArgs e)
{
string MyConnString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source="+Server.MapPath(".")+"db2.mdb;";
MyConn = new OleDbConnection(MyConnString);
MyConn.
<Script Language="C#" Runat="Server">
OleDbConnection MyConn;
public void Page_Load(Object src,EventArgs e)
{
//连接语句
string MyConnString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source="+Server.MapPath(".")+"..//DataBase//db1.mdb;";
MyConn = new OleDbConnection(MyConnString);
MyConn.Open();
在VS.NET中我想全局申明OleDbConnection:(当然,现在MyConn无法用,没有申明)
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid score;
private void Page_Load(object sender, System.EventArgs e)
{
string MyConnString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source="+Server.MapPath(".")+"db2.mdb;";
MyConn = new OleDbConnection(MyConnString);
MyConn.