错误插入 [英] error insert into

查看:76
本文介绍了错误插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是asp.net世界的新手。


我第一次网络测试时出错。

这里我的代码:

hi guys,
i just new in asp.net world.

i have an error for my first web test.
here my code :

展开 | 选择 | Wrap | 行号

推荐答案

好,我认为这可能与您创建SQL命令查询的方式有关。


您不应该通过将字符串连接在一起来动态创建SQL命令查询。您应该使用参数。原因有很多。



首先,使用参数可以帮助您查看SQL查询中出错的位置。


其次,正如您现在构建SQL查询一样,您的应用程序容易受到 SQL注入攻击


请查看如何在程序中使用数据库示例,了解如何使用SQL命令的参数。
Well, I think it might have to do with how you''re creating your SQL command query.

You should not be dynamically creating your SQL command query by concatenating a string together. You should be using parameters instead. There are a number of reasons why.


First of all, using parameters will help you see where you have made an error in your SQL query.

Secondly, building SQL queries as you are right now leave your application vulnerable to a SQL Injection Attack.

Please check out the article on how to use a database in your program examples on how to use parameters for your SQL commands.


我认为数据库中的字段数据类型存在一些问题。由于你的查询有串联问题。


首先检查你的数据类型的字段,如果有任何字段的数据类型为整数,那么不要在你的字段中使用外套查询连接。

希望你的问题能解决。


maliksleo
i think there is some problem of data type of your fields in database. Due to witch your query has concatenation problem.

first of all check your data types of fields and if there is any field having data type of integer then dont use coats for that field in your query for concatenation.
Hope your problem will be solved by this.

maliksleo


非常感谢你建议。


i有一些数据类型不同的数据。我试图将数据存储到参数中。但它仍然没有奏效。

well thank you for the advice.

i have a few data with different data type. i tried to stored the data into parameters. but still it didn''t work.

展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于错误插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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