组合组合框数据,并将其作为文本插入到(dbase)单列中. [英] Combining comboboxes data,and inserting into(dbase) single column as a text.

查看:67
本文介绍了组合组合框数据,并将其作为文本插入到(dbase)单列中.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生您好,
我正在Asp.net中做我的项目.我知道Visual Studio中存在数据选择器.

我不想使用该控件.因此,到目前为止,我创建了三个组合框(ajax控件).在这三个组合框中,一个是"day","month","year".我对所有组合框都很着迷.按钮称为保存".

在dB(SQL Server)中,仅显示一列,即日期"列.如果我输入天",月",年"并点击保存"按钮,则所有组合框将被添加并显示为单列.

示例:如果我在天"列中选择"20",在月"列中选择"3",在年"列中选择"2012".
在要显示的dBase 20-03-2012中,只要我点击保存"按钮.

怎么做到这个先生,请帮助我.

谢谢,
Pradeep CBZ

Hello sir,
I am doing my project in Asp.net. I know that in Visual studio data picker is present.

I dont want to use that control.So as of now i created a three combobox(ajax control).In those three combobox one is "day","month","year".Thing i made retived to all comboboxes.And One button called "Save".

In dB(SQL Server),only one column is present ie., "Date" column.If i enter a "day","month","year" and tap a "Save" button,then all the combobox get added and displayed as in single column.

Exmaple:If i select in "day" column as 20,and"month" coulmn as 3 and "year"col as 2012.
In dBase 20-03-2012 as to be displayed,.as soon as i tap a "save" button.

How to achive this sir,plz do help me..

Thanks,
Pradeep CBZ

推荐答案

DateTime 结构具有构造函数重载,该构造函数接受年,月和日作为参数,如此处所述
DateTime构造函数(Int32,Int32,Int32) [
The DateTime structure has got a constructor overload which accepts year, month and day as arguments as explained here
DateTime Constructor (Int32, Int32, Int32)[^]
Retrieve the year, month and day from the corresponding ComboBox and create a date as shown below
DateTime date = new DateTime(2012,3,20);
Console.WriteLine ("{0:dd-MM-yyyy}",date);
//output
//20-03-2012


使用上面创建的日期保存到数据库


Use the date created above to save to the database


这篇关于组合组合框数据,并将其作为文本插入到(dbase)单列中.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆