31 个解决方案
#1
大虾,救命啊!
#2
代码如下,我是通过union语句把他们连接在一起的,但是不知道怎么才能实现对他们的删除?
public void binddata1()
{
int i,y;
float rubbishCapacity=0;
string strSQL;
this.DBconn();
this.DBopen();
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
// Create DataAdapter object for update and other operations
SqlDataAdapter thisAdapter = new SqlDataAdapter( strSQL,this.DBconn());
// Create CommandBuilder object to build SQL commands
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
// Create DataSet to contain related data tables, rows, and columns
DataSet ds = new DataSet();
thisAdapter.Fill(ds, "RubbishInfo");
DataTable dt = ds.Tables[0];
dt.Columns.Add("RowID",Type.GetType("System.Int32"));
dt.AcceptChanges();
DataView dv=dt.DefaultView;
i = 1;
foreach(DataRowView drwv in dv)
{
drwv["RowID"] = i;
i += 1;
}
y=(int)ds.Tables["RubbishInfo"].Rows.Count;
for(i=0;i<y;i++)
{
rubbishCapacity+=Convert.ToSingle(ds.Tables["RubbishInfo"].Rows[i]["Capacity"]);
}
DataGrid1.DataSource=new DataView(ds.Tables["RubbishInfo"]);
DataGrid1.DataBind();
DropDownList1.SelectedIndex=2;
DropDownList2.SelectedIndex=2;
this.DBclose();
TextBox4.Text=Convert.ToString(y);
TextBox5.Text=Convert.ToString(dt.Rows.Count);
TextBox6.Text=Convert.ToString(y);
TextBox7.Text=Convert.ToString(rubbishCapacity);
}
public void binddata1()
{
int i,y;
float rubbishCapacity=0;
string strSQL;
this.DBconn();
this.DBopen();
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
// Create DataAdapter object for update and other operations
SqlDataAdapter thisAdapter = new SqlDataAdapter( strSQL,this.DBconn());
// Create CommandBuilder object to build SQL commands
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
// Create DataSet to contain related data tables, rows, and columns
DataSet ds = new DataSet();
thisAdapter.Fill(ds, "RubbishInfo");
DataTable dt = ds.Tables[0];
dt.Columns.Add("RowID",Type.GetType("System.Int32"));
dt.AcceptChanges();
DataView dv=dt.DefaultView;
i = 1;
foreach(DataRowView drwv in dv)
{
drwv["RowID"] = i;
i += 1;
}
y=(int)ds.Tables["RubbishInfo"].Rows.Count;
for(i=0;i<y;i++)
{
rubbishCapacity+=Convert.ToSingle(ds.Tables["RubbishInfo"].Rows[i]["Capacity"]);
}
DataGrid1.DataSource=new DataView(ds.Tables["RubbishInfo"]);
DataGrid1.DataBind();
DropDownList1.SelectedIndex=2;
DropDownList2.SelectedIndex=2;
this.DBclose();
TextBox4.Text=Convert.ToString(y);
TextBox5.Text=Convert.ToString(dt.Rows.Count);
TextBox6.Text=Convert.ToString(y);
TextBox7.Text=Convert.ToString(rubbishCapacity);
}
#3
建议用store procedure后台实现
#4
to vielili(small cat)
可否说的详细点啊,我是个菜鸟啊!
可否说的详细点啊,我是个菜鸟啊!
#5
先在数据库里写个存储过程, 参数是SendMailAddress,分别在每一个表里delete 的是该address的记录(先判断是否存在,不判断也可以).
然后在你的程序中(假定数据库是SQL server):
SqlCommand sc = new SqlCommand(connection);
sc.CommandText = StoreProcedureName;
sc.CommandType = System.Data.CommandType.StoredProcedure;
sc.Parameters.Add(....);
sc.ExecuteNonQuery();
然后在你的程序中(假定数据库是SQL server):
SqlCommand sc = new SqlCommand(connection);
sc.CommandText = StoreProcedureName;
sc.CommandType = System.Data.CommandType.StoredProcedure;
sc.Parameters.Add(....);
sc.ExecuteNonQuery();
#6
to vielili(smaill cat)
大虾,能给个例子吗?
大虾,能给个例子吗?
#7
好可怜啊,没有人回答我啊!
#8
up
#9
多谢!
#10
專門用一列來說明它屬於哪個表(表名),設這列的Visable = false;
照樣可以datagrid.Items[i].Cells[4].Text.ToString()來讀
照樣可以datagrid.Items[i].Cells[4].Text.ToString()來讀
#11
谢谢!
#12
请问,如果你要删除的数据是否在三个表中唯一,即一条记录在三个表中只存一份。如果是这样的话,还能删除此条记录,如果不是,由于无法判断记录的来源,很容易误删。
#13
是只存一份啊!
#14
to Knight94(愚翁)
我不說了麼
用一個隱含的列來表示這一行屬於哪一個表,這一列是不可見
但照 樣可以讀
我不說了麼
用一個隱含的列來表示這一行屬於哪一個表,這一列是不可見
但照 樣可以讀
#15
to sk9979(sk)
不是
只要你每個表有一字段唯一(即每個表有主鍵就可以)
並不是一条记录在三个表中只存一份
不是
只要你每個表有一字段唯一(即每個表有主鍵就可以)
並不是一条记录在三个表中只存一份
#16
to pengweihua(pwh)
那怎么样才能实现你说的,添加一个隐藏列,来保存各自的表名啊,对不起,我是个菜鸟,刚学.net 两个月!!!
那怎么样才能实现你说的,添加一个隐藏列,来保存各自的表名啊,对不起,我是个菜鸟,刚学.net 两个月!!!
#17
this.DataGrid1.Columns[1].Visible = false;//假如2列為表名列
>>>>>来保存各自的表名啊
那我先問一下:
你如何把三個表綁定在datagrid上????
說一下你的思路??、
>>>>>来保存各自的表名啊
那我先問一下:
你如何把三個表綁定在datagrid上????
說一下你的思路??、
#18
我的源程序在上面啊,大虾 你看一下开始的地方啊,主要是通过union 把他们合并到一个表,然后将这个表绑定到datagrid中
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
#19
建義用SP
添加一個字段tablename;
添加一個字段tablename;
#20
to pengweihua(pwh)
我也知道this.DataGrid1.Columns[1].Visible = false;可以实现将一列隐藏,关键是我不知道,如何才能将不同的表名绑定到该列,因为数据库中并没有表名这一列,听说可以使用动态添加一列,但是我不知道如何才能对这一列赋值,通过下面语句可以实现对添加的列赋值但是那几个不同的表名,应该怎样定位啊,难道要先把这几个表从数据库中读出来,然后把他们加一个表名列,然后再用union连接啊?
aDataTable.Culumns.Add(new DataColumn("序号", typeof(int)));
for(int i = 0; i < aDataTable.Rows.Count; i++)
{
aDataTable.Rows[i]["序号"] = i + 1;
}
我也知道this.DataGrid1.Columns[1].Visible = false;可以实现将一列隐藏,关键是我不知道,如何才能将不同的表名绑定到该列,因为数据库中并没有表名这一列,听说可以使用动态添加一列,但是我不知道如何才能对这一列赋值,通过下面语句可以实现对添加的列赋值但是那几个不同的表名,应该怎样定位啊,难道要先把这几个表从数据库中读出来,然后把他们加一个表名列,然后再用union连接啊?
aDataTable.Culumns.Add(new DataColumn("序号", typeof(int)));
for(int i = 0; i < aDataTable.Rows.Count; i++)
{
aDataTable.Rows[i]["序号"] = i + 1;
}
#21
既然只有一份,那么删除数据库,在三个表中用同样的条件来进行删除不就行了。
#22
to knight94(愚翁)
但是我用union 来合并后绑定,肯定只能合并相同的字段啊,不可能把他门各自的主键都合并进去啊!
但是我用union 来合并后绑定,肯定只能合并相同的字段啊,不可能把他门各自的主键都合并进去啊!
#23
to pengweihua(pwh)
大虾您可否说的不要这么经典啊,我现在装了金山毒霸2003用不了帮助,你可否给我个例子啊?多谢了!!!
大虾您可否说的不要这么经典啊,我现在装了金山毒霸2003用不了帮助,你可否给我个例子啊?多谢了!!!
#24
up
#25
strSQL="select 'ReceiveMailInfo'as tablename, SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select SendMailInfo'as tablename, MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select DraftInfo as tablename MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
Session["AccountID"]+
" union"+" select SendMailInfo'as tablename, MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select DraftInfo as tablename MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
#26
strSQL="select 'ReceiveMailInfo'as tablename, SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select SendMailInfo'as tablename, MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select 'DraftInfo' as tablename MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
#27
同意 pengweihua(pwh) ( )
#28
to pengweihua(pwh)
非常感谢大虾,不厌其烦的教诲!!!
但还是不行,主要是主键没有保存,请问你知道怎么样才能将数据库中读出的字段改名字啊,因为我的几张表的主键名字不同。
非常感谢大虾,不厌其烦的教诲!!!
但还是不行,主要是主键没有保存,请问你知道怎么样才能将数据库中读出的字段改名字啊,因为我的几张表的主键名字不同。
#29
一樣的方法,把它們的主鍵名字改成一樣(用存儲過程)
再綁定上去
再綁定上去
#30
不会把,一定要用存储过程才能做吗?
#31
我已经实现了,感谢pengweihua(pwh)大虾 的鼎立支持!!!
#1
大虾,救命啊!
#2
代码如下,我是通过union语句把他们连接在一起的,但是不知道怎么才能实现对他们的删除?
public void binddata1()
{
int i,y;
float rubbishCapacity=0;
string strSQL;
this.DBconn();
this.DBopen();
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
// Create DataAdapter object for update and other operations
SqlDataAdapter thisAdapter = new SqlDataAdapter( strSQL,this.DBconn());
// Create CommandBuilder object to build SQL commands
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
// Create DataSet to contain related data tables, rows, and columns
DataSet ds = new DataSet();
thisAdapter.Fill(ds, "RubbishInfo");
DataTable dt = ds.Tables[0];
dt.Columns.Add("RowID",Type.GetType("System.Int32"));
dt.AcceptChanges();
DataView dv=dt.DefaultView;
i = 1;
foreach(DataRowView drwv in dv)
{
drwv["RowID"] = i;
i += 1;
}
y=(int)ds.Tables["RubbishInfo"].Rows.Count;
for(i=0;i<y;i++)
{
rubbishCapacity+=Convert.ToSingle(ds.Tables["RubbishInfo"].Rows[i]["Capacity"]);
}
DataGrid1.DataSource=new DataView(ds.Tables["RubbishInfo"]);
DataGrid1.DataBind();
DropDownList1.SelectedIndex=2;
DropDownList2.SelectedIndex=2;
this.DBclose();
TextBox4.Text=Convert.ToString(y);
TextBox5.Text=Convert.ToString(dt.Rows.Count);
TextBox6.Text=Convert.ToString(y);
TextBox7.Text=Convert.ToString(rubbishCapacity);
}
public void binddata1()
{
int i,y;
float rubbishCapacity=0;
string strSQL;
this.DBconn();
this.DBopen();
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
// Create DataAdapter object for update and other operations
SqlDataAdapter thisAdapter = new SqlDataAdapter( strSQL,this.DBconn());
// Create CommandBuilder object to build SQL commands
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
// Create DataSet to contain related data tables, rows, and columns
DataSet ds = new DataSet();
thisAdapter.Fill(ds, "RubbishInfo");
DataTable dt = ds.Tables[0];
dt.Columns.Add("RowID",Type.GetType("System.Int32"));
dt.AcceptChanges();
DataView dv=dt.DefaultView;
i = 1;
foreach(DataRowView drwv in dv)
{
drwv["RowID"] = i;
i += 1;
}
y=(int)ds.Tables["RubbishInfo"].Rows.Count;
for(i=0;i<y;i++)
{
rubbishCapacity+=Convert.ToSingle(ds.Tables["RubbishInfo"].Rows[i]["Capacity"]);
}
DataGrid1.DataSource=new DataView(ds.Tables["RubbishInfo"]);
DataGrid1.DataBind();
DropDownList1.SelectedIndex=2;
DropDownList2.SelectedIndex=2;
this.DBclose();
TextBox4.Text=Convert.ToString(y);
TextBox5.Text=Convert.ToString(dt.Rows.Count);
TextBox6.Text=Convert.ToString(y);
TextBox7.Text=Convert.ToString(rubbishCapacity);
}
#3
建议用store procedure后台实现
#4
to vielili(small cat)
可否说的详细点啊,我是个菜鸟啊!
可否说的详细点啊,我是个菜鸟啊!
#5
先在数据库里写个存储过程, 参数是SendMailAddress,分别在每一个表里delete 的是该address的记录(先判断是否存在,不判断也可以).
然后在你的程序中(假定数据库是SQL server):
SqlCommand sc = new SqlCommand(connection);
sc.CommandText = StoreProcedureName;
sc.CommandType = System.Data.CommandType.StoredProcedure;
sc.Parameters.Add(....);
sc.ExecuteNonQuery();
然后在你的程序中(假定数据库是SQL server):
SqlCommand sc = new SqlCommand(connection);
sc.CommandText = StoreProcedureName;
sc.CommandType = System.Data.CommandType.StoredProcedure;
sc.Parameters.Add(....);
sc.ExecuteNonQuery();
#6
to vielili(smaill cat)
大虾,能给个例子吗?
大虾,能给个例子吗?
#7
好可怜啊,没有人回答我啊!
#8
up
#9
多谢!
#10
專門用一列來說明它屬於哪個表(表名),設這列的Visable = false;
照樣可以datagrid.Items[i].Cells[4].Text.ToString()來讀
照樣可以datagrid.Items[i].Cells[4].Text.ToString()來讀
#11
谢谢!
#12
请问,如果你要删除的数据是否在三个表中唯一,即一条记录在三个表中只存一份。如果是这样的话,还能删除此条记录,如果不是,由于无法判断记录的来源,很容易误删。
#13
是只存一份啊!
#14
to Knight94(愚翁)
我不說了麼
用一個隱含的列來表示這一行屬於哪一個表,這一列是不可見
但照 樣可以讀
我不說了麼
用一個隱含的列來表示這一行屬於哪一個表,這一列是不可見
但照 樣可以讀
#15
to sk9979(sk)
不是
只要你每個表有一字段唯一(即每個表有主鍵就可以)
並不是一条记录在三个表中只存一份
不是
只要你每個表有一字段唯一(即每個表有主鍵就可以)
並不是一条记录在三个表中只存一份
#16
to pengweihua(pwh)
那怎么样才能实现你说的,添加一个隐藏列,来保存各自的表名啊,对不起,我是个菜鸟,刚学.net 两个月!!!
那怎么样才能实现你说的,添加一个隐藏列,来保存各自的表名啊,对不起,我是个菜鸟,刚学.net 两个月!!!
#17
this.DataGrid1.Columns[1].Visible = false;//假如2列為表名列
>>>>>来保存各自的表名啊
那我先問一下:
你如何把三個表綁定在datagrid上????
說一下你的思路??、
>>>>>来保存各自的表名啊
那我先問一下:
你如何把三個表綁定在datagrid上????
說一下你的思路??、
#18
我的源程序在上面啊,大虾 你看一下开始的地方啊,主要是通过union 把他们合并到一个表,然后将这个表绑定到datagrid中
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
strSQL="select SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
#19
建義用SP
添加一個字段tablename;
添加一個字段tablename;
#20
to pengweihua(pwh)
我也知道this.DataGrid1.Columns[1].Visible = false;可以实现将一列隐藏,关键是我不知道,如何才能将不同的表名绑定到该列,因为数据库中并没有表名这一列,听说可以使用动态添加一列,但是我不知道如何才能对这一列赋值,通过下面语句可以实现对添加的列赋值但是那几个不同的表名,应该怎样定位啊,难道要先把这几个表从数据库中读出来,然后把他们加一个表名列,然后再用union连接啊?
aDataTable.Culumns.Add(new DataColumn("序号", typeof(int)));
for(int i = 0; i < aDataTable.Rows.Count; i++)
{
aDataTable.Rows[i]["序号"] = i + 1;
}
我也知道this.DataGrid1.Columns[1].Visible = false;可以实现将一列隐藏,关键是我不知道,如何才能将不同的表名绑定到该列,因为数据库中并没有表名这一列,听说可以使用动态添加一列,但是我不知道如何才能对这一列赋值,通过下面语句可以实现对添加的列赋值但是那几个不同的表名,应该怎样定位啊,难道要先把这几个表从数据库中读出来,然后把他们加一个表名列,然后再用union连接啊?
aDataTable.Culumns.Add(new DataColumn("序号", typeof(int)));
for(int i = 0; i < aDataTable.Rows.Count; i++)
{
aDataTable.Rows[i]["序号"] = i + 1;
}
#21
既然只有一份,那么删除数据库,在三个表中用同样的条件来进行删除不就行了。
#22
to knight94(愚翁)
但是我用union 来合并后绑定,肯定只能合并相同的字段啊,不可能把他门各自的主键都合并进去啊!
但是我用union 来合并后绑定,肯定只能合并相同的字段啊,不可能把他门各自的主键都合并进去啊!
#23
to pengweihua(pwh)
大虾您可否说的不要这么经典啊,我现在装了金山毒霸2003用不了帮助,你可否给我个例子啊?多谢了!!!
大虾您可否说的不要这么经典啊,我现在装了金山毒霸2003用不了帮助,你可否给我个例子啊?多谢了!!!
#24
up
#25
strSQL="select 'ReceiveMailInfo'as tablename, SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select SendMailInfo'as tablename, MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select DraftInfo as tablename MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
Session["AccountID"]+
" union"+" select SendMailInfo'as tablename, MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select DraftInfo as tablename MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
#26
strSQL="select 'ReceiveMailInfo'as tablename, SendMailAddress,MailSubject,WriteMailTime,Capacity , IsRubbish from ReceiveMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select SendMailInfo'as tablename, MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from SendMailInfo where IsRubbish=1 and AccountID="+
Session["AccountID"]+
" union"+" select 'DraftInfo' as tablename MailSubject,SendMailAddress,WriteMailTime,Capacity,IsRubbish from DraftInfo where IsRubbish=1 and AccountID="+
Session["AccountID"];
#27
同意 pengweihua(pwh) ( )
#28
to pengweihua(pwh)
非常感谢大虾,不厌其烦的教诲!!!
但还是不行,主要是主键没有保存,请问你知道怎么样才能将数据库中读出的字段改名字啊,因为我的几张表的主键名字不同。
非常感谢大虾,不厌其烦的教诲!!!
但还是不行,主要是主键没有保存,请问你知道怎么样才能将数据库中读出的字段改名字啊,因为我的几张表的主键名字不同。
#29
一樣的方法,把它們的主鍵名字改成一樣(用存儲過程)
再綁定上去
再綁定上去
#30
不会把,一定要用存储过程才能做吗?
#31
我已经实现了,感谢pengweihua(pwh)大虾 的鼎立支持!!!