(1)gridview里面的dropdownlist如何绑定数据?
(2)两个日期如何在后台进行比较看谁大?
-----------------------------------------------
http://www.vancl.com/ 谁能做一个这样的网站?能做的给我一个报价,和联系地址
(2)两个日期如何在后台进行比较看谁大?
-----------------------------------------------
http://www.vancl.com/ 谁能做一个这样的网站?能做的给我一个报价,和联系地址
日期比较:有个TimeSpan System.TimeSpan span= DateTime1 - DateTime2;
网站:只需要找个模板就行了
{}
2.DateTime.Compare(dt1,dt2);(有人说了)p://www.vancl.com/ 没什么兴趣,需求太不明确了。估计是需求源源不断增加
<Columns>
<asp:TemplateField HeaderText="CATALOGID">
<EditItemTemplate>
<asp:TextBox ID="txtCATALOGID" runat="server" Text='<%# Bind("CATALOGID") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lbtnCATALOGID" runat="server" Text='<%# Eval("CATALOGID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SortID">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSource="<%# GetSort() %>" DataTextField="SortName" DataValueField="SortID" SelectedValue='<%# Bind("SortID") %>'>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lbtnSortID" runat="server" Text='<%# Eval("SortID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField> </Columns>
</asp:GridView> 后台调用 /*绑定Dropdanglisite*/
public DataSet GetSort()
{
string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=";
strConn += Server.MapPath("..\\App_Data\\Aqbiopharma.mdb");
OleDbConnection conn = new OleDbConnection(strConn);
string sql = "SELECT [SortID], [SortName] FROM [Sort]";
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
try
{
conn.Open();
da.Fill(ds,"b");
}
catch (Exception ex)
{
//Response.Write(ex.ToString());
}
finally
{
conn.Close();
}
return ds;
}
{ ListItem item = new ListItem();
item.Text = dictionaryInfo.DictDetallDesc;
item.Value = dictionaryInfo.ID.ToString();
((DropDownList)this.GridView1.Rows[e.NewEditIndex].Cells[2].FindControl("dropOwner")).Items.Add(item);
}((DropDownList)this.GridView1.Rows[e.NewEditIndex].Cells[2].FindControl("dropOwner")).Items.Add(item);
为什么这句话报错说:为将对象引用到其实例 ? 我是在这个事件里面写的GridView1_RowEditing