本文介绍了如何从asp.net中的sql server到dropdownlist获取smalldatetime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,



我的程序获得了像这种格式的smalldatetime记录

2013-04-16 00:00:00



如何使用asp.net和C在ShortDateString中显示这个日期#



con.Open() ;

//字符串caseTtl_qry =从tblLegealCases中选择distinct(Case_Title);

SqlCommand cmd = new SqlCommand(GetSingleEntryDates,con);

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.AddWithValue(@ Empid,Session [Empid]);

DataTable dt = new DataTable();



SqlDataAdapter sqlDa = new SqlDataAdapter(cmd);

sqlDa.Fill(dt);

DropDownSingleEntryDate.DataTextField =attendance_date;

DropDownSingleEntryDate.DataSource = dt;

DropDownSingleEntryDate.DataBind();

con.Close();





谢谢

vilas

Dear Sir ,

My procedure get the record of smalldatetime like this format
2013-04-16 00:00:00

how to show this dates in ShortDateString using asp.net and C#

con.Open();
// string caseTtl_qry = "select distinct( Case_Title) from tblLegealCases";
SqlCommand cmd = new SqlCommand("GetSingleEntryDates", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Empid", Session["Empid"]);
DataTable dt = new DataTable();

SqlDataAdapter sqlDa = new SqlDataAdapter(cmd);
sqlDa.Fill(dt);
DropDownSingleEntryDate.DataTextField = "attendance_date";
DropDownSingleEntryDate.DataSource = dt;
DropDownSingleEntryDate.DataBind();
con.Close();


thanks
vilas

推荐答案



这篇关于如何从asp.net中的sql server到dropdownlist获取smalldatetime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 15:59