数据库重现错误 [英] Data base retriving error

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

问题描述

我的组合框代码是休闲的

my code for combo box is as fallow

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
           try
           {
                button1.Enabled = true;
                button2.Enabled = true;
                button3.Enabled = true;
                textBox1.Enabled = false;

                myCon.Open();
                //int i = Convert.ToInt32(comboBox1.SelectedItem);
                //String i = comboBox1.SelectedItem.ToString();

                string sss = "select * from property where propno='" + comboBox1.SelectedItem.ToString() + "'";
                //Console.WriteLine(sss);

                OleDbCommand cmld = new OleDbCommand(sss, myCon);

                OleDbDataReader drsl = cmld.ExecuteReader();
                drsl.Read();

                textBox1.Text = drsl[0].ToString();
                textBox2.Text = drsl[1].ToString();
                textBox3.Text = drsl[2].ToString();
                textBox4.Text = drsl[3].ToString();
                textBox5.Text = drsl[4].ToString();
                comboBox2.Text = drsl[5].ToString();
                label9.Text=drsl[8].ToString();
                pictureBox1.Image = Image.FromFile(label9.Text);
                label10.Text=drsl[9].ToString();
                pictureBox2.Image = Image.FromFile(label10.Text);
                label11.Text=drsl[10].ToString();
                pictureBox3.Image = Image.FromFile(label11.Text);

                drsl.Close();
                myCon.Close();
                    

                  


                


           }
           catch (Exception ex) 
           {
            MessageBox.Show(ex.Message.ToString(), "Real Estate...    ", MessageBoxButtons.OK, MessageBoxIcon.Error); 
         }
        }







错误是条件表达式中的数据类型不匹配什么是&什么是Criteria表达式。 。




The error is Data type missmatch in criteria expression , what is it & what is Criteria expression . .

推荐答案

你好朋友



我认为你没有正确传递参数< b> propno 应该是数字,如 Int 类型,你将它作为字符串传递给



所以再次回顾一下你的数据类型.........在DB Table列和你的前代码之间



希望它能帮到你





乐于助人!!!
hello friend

I think that you're not passing your parameters correct probably the propno should be numeric like Int type and you are passing it as String

so review again about your Data Types.........between DB Table columns and your front code

hope it will help you


Happy to help!!!


string sss =select * from property where propno =+ comboBox1 .SelectedItem.ToString()+;
string sss = "select * from property where propno=" + comboBox1.SelectedItem.ToString() + "";


去抛出这个链接...



可能有帮助



数据类型不匹配在标准表达式错误。 MS Access VB.net [ ^ ]
go to throw this link...

may it help

Datatype mismatch in criteria expression error. MS Access VB.net[^]


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

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