在Windows窗体中将表字段添加到组合框. [英] Adding Table Field to Combobox in windows form.

查看:112
本文介绍了在Windows窗体中将表字段添加到组合框.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

请指导我如何从SQLserver数据库向Windows窗体和表的组合框添加表1或表2字段.请提供完整的代码,以便我可以将其应用于我的项目.
我正在使用VS2010和Databae SQLserver.
组合表Job_Category和我的连接如下:-

Dear Sir,

Please guide me how to add a Table 1 or 2 fields to a Combobox in Windows Form and Table from SQLserver Database.Kindly give complete code so I can apply to my project.
I''m using VS2010 and Databae SQLserver.
Combo Table Job_Category and my connection as follows:-

Imports System.Data.SqlClient
Public Class EmpEntryForm
    Dim connstring As String = "Data Source=.\SQLExpress;Initial Catalog=StudioSamra;Integrated Security=True;Pooling=False"
    
    Dim connection As New SqlConnection(connstring)
    Dim da As New SqlDataAdapter(connstring, conn)
    Dim sSql As String = "select * from Job_category" 

"组合表名称也将添加到组合中的字段是类别"


请帮帮我.
谢谢.

''Combo Table Name also Field to be add into combo is "Category"


Please help me.
Thanks.

推荐答案

请提供完整的代码,以便我可以将其应用于我的项目."

编号

请去做一些研究.

这并不困难.如果我们为您做功课,您将如何学习?

当您遇到特定问题时(除了我不会为我自己做这件事而烦恼"之外),请提出有关此问题的问题.在此期间,请尝试使用Google,尝试您的演讲笔记,自己尝试一下!
"Kindly give complete code so I can apply to my project."

No.

Kindly go and do some research.

This isn''t difficult. How will you learn if we do your homework for you?

When you have a specific problem (other than "I can''t be bothered to do it for myself") please ask a question about it. In the meantime, try Google, try your lecture notes, try something for yourself!


这篇关于在Windows窗体中将表字段添加到组合框.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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