从文本框中检索数据以从SQL Server中获取标签 [英] Retrieve the data from text box to label from sql server

查看:75
本文介绍了从文本框中检索数据以从SQL Server中获取标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


1)我已经在窗口应用程序中创建了一种形式.文本框包含时间,一个用于AM和PM用户的组合框将放置时间,然后他将选择AM或PM,但是我不明白如何将其同时放置在sql server中,也不了解如何加入它们.
================================================== ==========================
2)我采用了一个分组框,因为我放入了三个文本框和三个标签,意味着一行包含六个信息.
我想在文本框中执行sql连接,以便如果用户在文本中输入信息,并且应该在标签中检索数据.

================================================== ==========================
3)在分组框中,我放置了一个添加按钮,我希望如果用户单击添加"按钮,则下一行应在分组框中可见.我已经将所有文本框和标签都设为enable = false.
我已经为此编写了代码,但这给了我错误,这里是代码

Hi
1) I have create one form in window application. the text box contains time and one combo box for AM and PM user will put the time and then he will select AM or PM but i am not understanding how i put this both in sql server and don''t understand how do i join them.
==============================================================================
2) i have taken one group box in that i have put three text box and three label means one row contains six info.
i want to do sql connection on text box so that if user put info in the text and it should retrieve the data in the labels.

==============================================================================
3) In the group box i have put one add button i want that if user click on Add button next row should be visible in group box. i have have made all the text box and label enable = false.
i have wrote the code for it but it is giving me error here is the code

private void button2_Click(object sender, EventArgs e)
        {
        //  frmsalesorderbooking f2 = new frmsalesorderbooking();
        ////    groupBox1 gb = new GroupBox1();
        //  int topPosition = 5;
        //  for (int j = 0; j < Convert.ToInt32(textBox6.Text.ToString()); j++)
        //  {
        //      comboBox2 cb = new ComboBox1();
        //      cb.left = 5;
        //      cb.top = topPosition;
        //      topPosition += 30;
        //      gb.controls.Add(cb);
        //  }
        //  frmsalesorderbooking.Control.Add(gb);
        //  frmsalesorderbooking.show();
            if (Visible == false)
            {
                textBox14.Visible = true;
                textBox18.Visible = true;
                textBox27.Visible = true;
            }




请帮助我,我希望我已经明确了我想要的内容,请帮助


在此先感谢:rose :: rose :: rose:




please help me i hope i have made it clear what i want please help


thanks in advance :rose::rose::rose:

推荐答案

1.代码中有什么错误?
2.
1. what is the error in the code?
2.
frmsalesorderbooking.Control.Add(gb);


此行应该引发错误,因为您无法修改类,请在此处使用对象


This line should be raising error as you cannot modify class, use object instead which is

f2

代替.


这篇关于从文本框中检索数据以从SQL Server中获取标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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