回答我的问题 [英] answer for my question

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

问题描述

请告诉我下面的编码有什么问题


private void button1_Click(对象发送者,System.EventArgs e)
{

if(((textName.Text ==")||(textadd.Text =="))
{
MessageBox.Show(输入正确的数据");
返回;

}
cnn.Open(sqlconn,",",0);
对象接收;
字符串conn =(插入类别(categoryName,description)" +"VALUES(""+ textName.Text +"''," + textadd.Text +'')");
cnn.Execute(sqlconn,out recafec,0);
如果(Convert.ToInt32(recafec)== 1)
{
MessageBox.Show("updated");

}


}




如果您有解决办法
请向我解释

please inform me what is the wrong in the below coding


private void button1_Click(object sender, System.EventArgs e)
{

if ((textName.Text == " ") || (textadd.Text == " "))
{
MessageBox.Show("enter the proper data");
return;

}
cnn.Open(sqlconn," "," ",0);
object recafec;
string conn =( "INSERT INTO categories(categoryName,description)" + "VALUES('' " + textName.Text + "'',''" + textadd.Text + "'')");
cnn.Execute(sqlconn,out recafec ,0 );
if (Convert.ToInt32(recafec) == 1)
{
MessageBox.Show("updated");

}


}




if you get asolution
please explain me

推荐答案

对不起,但我很困惑.我们应该猜测是什么问题吗?
I''m sorry, but I am confused. Are we supposed to guess at what the problem is?


写道:​​

请告诉我什么是以下代码中的错误

please inform me what is the wrong in the below coding



1-您选择的主题很愚蠢.每个人都想要他们的问题的答案

2-



1 - your chosen subject is idiotic. EVERYONE wants an answer for their question

2 -

写道:​​

button1_Click

button1_Click




您似乎试图通过不给变量一个通俗易懂的名称来使代码不可读

3-





You seem to be trying to make your code unreadable, by not giving your variables sensible names

3 -


写道:​​

字符串conn =("INSERT INTO Categories(categoryName,description)" +"VALUES(""+ textName.Text +"' ',''"+ textadd.Text +"''));

string conn =( "INSERT INTO categories(categoryName,description)" + "VALUES('' " + textName.Text + "'',''" + textadd.Text + "'')");



您似乎对SQL注入一无所知,因此您正在编写一个带有数据库的系统,任何人都可以删除它.

4-您发布模糊的问题,几乎就像您不想回答一样.是什么让您感到此代码不起作用?您期望它做什么?它有什么作用 ?您会得到什么错误消息(如果有),并由什么行生成?

请编辑您的帖子,并尝试根据我们需要了解的知识来尝试为您提供帮助.



You seem to know nothing about SQL injection, so you''re writing a system with a database that anyone can erase if they want to.

4 - you post vague questions, almost as if you don''t want an answer. What makes you feel this code is not working ? What do you expect it to do ? What does it do ? What error message, if any, do you get, and what line generates it ?

Please edit your post and try to think in terms of what we need to know in order to try to help you.


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

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