我们如何将选定的日历日期发送到数据库 [英] how do we send selected Calender date to the database

查看:64
本文介绍了我们如何将选定的日历日期发送到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人可以帮助我.我使用了asp.net压光机控件.

感谢您的帮助.

Could any body help me. I used asp.net calender control.

Thanks for helping.

推荐答案

您在这里遇到的问题是使用ExecuteReader(),您使用此方法访问数据.它提供了仅前向,只读,已连接的数据集. ExecuteReader通常用于MIN,MAX,SELECT查询.

对于INSER,UPDATE,DELETE查询,应使用
Your problem here you are using ExecuteReader() you use this method for accessing data. It provides a forward only, read-only, connected dataset. Mostly ExecuteReader is used for MIN,MAX, SELECT queries.

For INSER, UPDATE, DELETE queries you should use
ExecuteNonQuery()

.基本上,它用于数据操作.因此,更改您的ExecuteCommand类型.

祝您好运.

. Basically it is used for data manipulation. So change your ExecuteCommand type.

Good luck.


假设您是通过后面的代码发送的,完成所有验证后,只需准备INSERT命令,并将其添加为参数化查询即可.就像处理其他任何数据一样.
Assuming you are sending it via your code behind, after you have done all your validations, just prepare your INSERT command, and add it as a Parametrized query. Just as you would any other data.


这篇关于我们如何将选定的日历日期发送到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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