如何在数据库中存储值默认值,而不是在设计页面中设计的默认值 [英] how to store values in databse default that default value not designed in design page
问题描述
我有设计页面。如下;
名称textbox1
DOB textbox2
WEdding textbox3
手机短信4
电子邮件文本框5
数据库如下;
name varchar
DOB日期时间
婚礼日期时间
mobile varchar
电子邮件varchar
Actviate varchar
当我在数据库中默认运行Activate时(数据库''''中的列必须存储在未设计的数据库中页面)
通过sql查询如何将激活值插入数据库。
请告诉告诉查询。
选择姓名,DOB ,婚礼,手机,电子邮件,激活从
[您的表名]其中Name =''[Desire Name]''
如果你想要默认值那么
在你的控件上设置道具,如果你没有提供价值,那么它们将显示默认值,
或检查数据集计数是否为0然后设置值。
只需在修改模式下打开表格
现在选择列''< b>激活''
见,列属性
set 默认值 = A
注意:默认值不会应用于现有记录。
所以,你必须手动更新它们...
如果你要添加新记录,如果你没有传递''激活'的价值那么它将会显示你'A''(设置为默认值)
快乐编码!
:)
i have design page.that as follows;
Name textbox1
DOB textbox2
WEdding textbox3
Mobile textbox4
Email Textbox5
Database as follows;
name varchar
DOB Datetime
Wedding datetime
mobile varchar
Email varchar
Actviate varchar
in that when i run in database default in Activate(column in database ''A'' has to stored in database not designed in design page)
through sql query how to insert the activate value to the database.
please tell tell the query.
Hi,
Select Name,DOB,Wedding,Mobile,Email,Activate From
[Your Table Name] where Name=''[Desire Name]''
If you want default value then
set prop at your controls, if you not supplied value then they will display default ,
or check for dataset count if 0 then set values.
just open table in modify mode
now select column ''Activate''
see, Column properties
set Default value = A
Note: default value will not applied on existing records.
so, you have to update them manually...
when ever you will add new record and if you are not passing value of ''Activate'' then it will show you ''A''(which is set as default value)
Happy Coding!
:)
这篇关于如何在数据库中存储值默认值,而不是在设计页面中设计的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!