Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÈçºÎÔÚÊý¾Ý¼¯ÉÏʹÓÃsql²éѯÓï¾ä? - .NET¼¼Êõ / VB.NET

ÈçÓÐÊý¾Ý¼¯dataset1,Ìí³äÁËÒ»¸öÈËÔ±ÐÅÏ¢±ítable1(ID,ÐÕÃû,ÐÔ±ð)

ÎÒÏëÔÚÕâ¸ö±íÉϲéѯÐÕÃûΪÄеļǼ,²¢°ÑËûÃÇÌí¼Óµ½datagridview1ÉϸÃÔõô°ì,ÓеãÂÒÁË,ʵÔÚÏë²»ÆðÀ´ÁË.

ͬÀàÎÊÌâ,Èç¹ûÊý¾Ý¼¯ÖÐÓÐÁ½¸öÒÔÉϵıí,ÒªÏë½øÐи´ÔӵIJéѯ¸ÃÔõô°ì?
Dim nn As New SqlClient.SqlConnection
 nn.ConnectionString = "Data Source=(local);Initial Catalog='Êý¾Ý¿âÃû';Integrated Security=SSPI"
  nn.Open()
  Dim kz As New SqlClient.SqlDataAdapter(select * from table where ÐÔ±ð='ÄÐ', nn)
  Dim da As New DataTable
  kz.Fill(da)
datagridview1.DataSource=da

Á½¸ö±íÒÔÉϽøÐи´ÔÓ²éѯµÄ»°£¬ÓÃËüÃÇÖ®¼äµÄÖ÷¼ü½øÐÐÁªÏµ¾Í¿ÉÒÔÁË£¡

Dim str As String
  Dim ds As New DataSet
  Dim da As SqlDataAdapter
  str = "data source=localhost;initial catalog=±í¸ñÃû;integrated security=true"
  Dim con As New SqlConnection(str)
  con.Open()
  Dim sql As String = "select * from ±í¸ñÃû"
  da = New SqlDataAdapter(sql, con)
  da.Fill(ds)
  DataGrid1.DataSource = ds.Tables(0)

VB.NET code:
Dim dv As DataView = dataset1.Tables(0).DefaultView
dv.RowFilter = "ÐÔ±ð='ÄÐ'"
datagridview1.DataSource=dv




Ïà¹ØÎÊ´ð£º

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......

sqlССµÄÒÉÎÊ - .NET¼¼Êõ / C#

¿ÉÄÜÒòΪ¹¤×÷µÄÔ­Òò ½Ó´¥Êý¾Ý¿âÕâ¿é±È½ÏÉÙ£¬Ö®Ç°¶¼ÊÇ×ö³ÌÐòÕâ¿é£¬Êý¾Ý¿âÕâ¿é¶¼ÓÐרÃŵÄÈËÀ´×ö ·Ö¹¤¶¼ºÜÃ÷ϸ ËùÒÔ¶ÔÊý¾Ý¿âÕâÒ»¿éÍêÈ«²»Á˽⡣ǰ¶Îʱ¼ä È¥ÃæÊÔÁ˼¸¼Ò¹«Ë¾ ¼¸ºõ¶¼ÊÇÔÚÊý¾Ý¿âÕâ¿é¹ÒµôµÄ Á¬¸ö¼òµ¥µÄSQ ......

vb ÖÐ - VB / »ù´¡Àà

ÏÖÔÚÎÒÏë¸ù¾ÝtreeviewÉÏÿ¸ö½ÚµãµÄȨÏÞ£¬Ã»ÓÐȨÏ޵Ľڵ㲻Äܱ»Ñ¡ÖУ¬¶øÇҳɻÒÉ«£¬ÔõôʵÏÖ£¬ÔÚÏߵȡ£¡£¡£
Õâ¸ö£¿¡£¡£¡£
òËÆû·¨¡£
ÊÔÊÔÄܲ»ÄܸÄijЩnodeµÄÑÕÉ«£¬¼Ç¼ÏÂÉϴεÄnodeclickÀïµÄnode¡£
Ï´εã»÷µÄÈç¹ ......

vb - VB / »ù´¡Àà

vbÖÐ ÏÖÔÚÎÒÒª°ÑÊý¾Ý¿âÀï´æ´¢µÄÒ»¸ö¸½¼þµÄÄÚÈÝÌæ»»ÁË£¬Ôõô×ö£¬Ö»ÊÇÌæ»»ÎÒÖ¸¶¨µÄλÖ㬲»ÊÇÈ«²¿Ìæ»»
Ç뽫ÎÊÌâ˵Ã÷°×£¬´æ´¢×ֶθñʽ£¬Èç¹ûÊÇBinary¸ñʽµÄ±È½ÏÂé·³£¬Èç¹ûÊÇ×Ö´®£¬Ö±½ÓÌæ»»¡£×îºÃ²»Òª½øÐÐÖ¸¶¨Î»ÖÃÌæ»»¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ