ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

vb¦b¸ê®Æ®wªºÀ³¥Î

vb¦b¸ê®Æ®wªºÀ³¥Î

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-15 13:40 ½s¿è

§Ú­ÌµL½×°µ¤°»ò¨Æ,³£·|±q¥~³¡±µ¦¬°T®§
¹LÂo³o¨Ç°T®§¦¨¬°¦³¥Îªº¸ê®Æ¦Ó¦s©ó¹q¸£¤¤,´N¥i¥H¤è«K¤é«á¦s¨ú
¦ý¬O¦pªG¸ê®Æ¹L©óÃe¤j,´N¤£§Q©ó¤é«á·j´M,À˯Á
·íµM,§Ú­Ì¤]¥i¥H§Q¥Î¹êÅé¸ê®Æ®w,§Q¦p¸ê®Æ®Ñ­±¤Æ,¦ý©Ò¦û¥ÎªºªÅ¶¡«D±`¦h
¬d¸ß§xÃø,
©Ò¥H¹q¸£ªº¸ê®Æ®w´N¬O§Ú­Ì²{¤µ³Ì±`¨Ï¥ÎªºÀx¦s¸ê®Æ®wªº¤u¨ã
Àx¦s¸ê®Æ¦³Àx¦s¸ê®Æªº³W«h©Ê,§Ú­Ì®É±`¬Ý¨ìºô¤Í­Ì¦bexcel¤W°µ¥X«Ü¦h
«Üº}«Gªº³øªí,µM«á­n¨D¦UªO¥D­Ì¬O§_¯à±N¥L­Ìªº³øªí¦Û°Ê¤Æ,µL½×¬O§Q¥Îexcelªº¤½¦¡
©ÎªÌ¬O§Q¥Îvba,³o­Ó¨ä¹ê¬O¤£²Å¦X®Ä¯qªº,´N²{¤µªºÆ[ÂI¦Ó¨¥,³øªí¬O³Ì²×¿é¥X,§Ú­Ì¤@©w
¤£·|¥u­n¤@ºØ³øªí,¦Ó³o¤£¤@©w¥u¬O¤@ºØ³øªí¤¤«Ü¦h³£¬O¥Ñ¦P¤@µ§¸ê®Æ©Ò²Õ¦¨,©Î¥Ñ¸Óµ§
¸ê®Æ¾É¥Xµ²ªG,¦pªG§Ú­Ì¦bexcel¸ê®Æªí¤¤«Ø¥ß¦UÀx¦s®æ¤¤ªºÃö³s,³Ì«á¤@©w¬O§Ñ¤F¨º¤@­Ó
¤~¬O¯u¥¿ªº¥D¸ê®Æ,¦Ó¥B¥D­n¸ê®Æ³Q´²¦b¦U¸ê®Æªí¤¤,³Ì«áºÞ²z°_¨Ó¤@©w¬Û·í¤£«K,¤@­Ó¿ù
´N¥þ½L³£¿ù,§Ú­Ì±`¬Ý¨ì¦ÑÁó­Ì¦]¬°¨D§Ö,´N­n¨D¥u­n°µ¤°»ò´N¦n¤F,¨ä¹ê³o­Ó´N¬O³y¦¨¤é«á
ªº§xÂZ,²M¬d°_¨Ó«Ü§xÃø,¦Ó¥B§ó­«­nªº¬O­×§ï§xÃø,¦]¦¹§Ú­Ì¤~·|®É±`«Øij,¸ê®ÆÀx¦s³Ì¦n´N
¬O¥Î¤@µ§¤@µ§ªº,¤£­n¹³³øªí§Î¦¡,¦]¬°´Nºâ¬O§Ú­Ì¤£¥Î¼Ï¯Ã¤ÀªRªí,¦Ó¥Îªº¬O»y¨¥¶}µo¤¶­±¤u¨ã(vba,©Î¬Ovb,C#...)
³o¼Ë¤lµ{¦¡¼g°_¨Ó¤]¤ñ¸û»´ÃP

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-15 16:02 ½s¿è

excel³q±`¦³¨C­ÓÀx»W®æ¥L­Ìªº®æ¦¡
³]©w³o¨Ç®æ¦¡¦³§U©ó³t«×,Åý¹q¸£¨Æ¥ý¥i¥Hª¾¹D­n¦p¦ó³B²z¸ê®Æ
³o©Mµ{¦¡»y¨¥¤¤ªº«Å§i¬O¤@¼Ëªº,©w¸q³o¨Ç®æ¦¡©M«Å§iªº®Ä¥Î¬Oµ¥­Èªº
¦ýexcelªº®æ¦¡¨S¨º»òªºÄYÂÔ,­n©w¸q¤£©w¸q³£¥i¥H,³o¬O¦]¬°excel¤£¬O
¥Î¨Ó·í¸ê®Æ®wªº³nÅé,ÁöµM¤pªº¸ê®Æ®w§Ú±`¥Îexcel(¦p¤@­Ó±M®×ªº¸ê®Æ¥Îacess´N¤Ó¹L¤õ¤F)
³]©w³o¨Ç®æ¦¡Åý§Ú­Ì¥i¥H«Ü®e©ö±Æ§Ç,·j¯Á,§Ú­Ì¥u­n·Q¤@¤U´Nª¾¹D¤F
¦pªG¦³¤@µ§¸ê®Æ,¦p¤@­Ó¯Z¯Å¤¤©Ò¦³¤Hªº©m¦W¨­°ª,Åé­«,¨º¦pªGAªº¨­°ª©MBªº¨­°ª¤£¦b¦P¤@Äæ
µ¥¦P©ó§AÁÙ­n¼gµ{¦¡¥h±Æ,³o´N¬O®ö¶O,¦Ó¥B,¦pªG§A­n¿é¥X¤@±i¥d¤ù,Aªº¨­°ªÅé­«,¬O­nµ¹Aªº
Bªº¨­°ªÅé­«¬O­nµ¹Bªº,Ãø¹D§A¯uªº¥h°µ¤G±i³øªí,A¤@±i,B¤@±i,·íµM¤£¬O,¤@©w¬O§Ú¦b³øªí¤W¿ï
A´NÅã¥ÜA¸ê®Æ,¿ïB´N¬OB¸ê®Æ

TOP

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-15 17:08 ½s¿è

²{¤µªº¸ê®Æ®w¨t²Î¤j¦h¬°Ãö³s¦¡¸ê®Æ®w¨t²Î
·íµM¤]¦³«DÃö³s¦¡ªº,¦ýÃö³s¦¡¬O²{¤µªº¥D¬y
¬°¤°»ò·|±Ä¨úÃö³s¦¡,³Ì¥D­nªº­ì¦]ÁÙ¬O­nÁקKªÅ¶¡ªº®ö¶O

½s¸¹        ¯Z¯Å        ©m¦W        Åé­«        ¨­°ª
1        ¤»¦~¥Ò¯Z        ¦P¾Ç¥Ò        60        160
2        ¤»¦~¥Ò¯Z        ¦P¾Ç¤A        55        158
3        ¤»¦~¥Ò¯Z        ¦P¾Ç¤þ        49        150
4        ¤»¦~¥Ò¯Z        ¦P¾Ç¤B        46        152
5        ¤»¦~¥Ò¯Z        ¦P¾Ç¥³        50        155
6        ¤»¦~¥Ò¯Z        ¦P¾Ç¤v        52        162

¨Ò¦p, ¯Z¯ÅªºÄæ¦ì ³£¬O¤»¦~¥Ò¯Z,³o¥Nªí³o¤@Ä檺¸ê®Æ­«½Æ
§Ú­Ì¥i¥H§â¥L¿W¥ß¥X¨Ó,¥t°µ¯Z¯Å¸ê®Æªí,µM«á±Ä¨úÃö³s±N¤G­Ó¸ê®Æªí·f¤WÃö«Y
¨º»ò¥u­n¸ê®Æ¤@¦h,¸`¬ÙªºªÅ¶¡´N«ÜÅå¤H,³o´N¬OÃö³s¦¡¸ê®Æ®wªºÀuÂI,¦Ó³o­Ó°Ê§@
´N¥s¥¿³W¤Æ(Normalized)

TOP

ÁÂÁ¤j¤jªº¤À¨É¡A§Æ±æ¥¼¨Ó¯à¦h¦h«ü¾É¤p§Ì!!!

TOP

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-16 06:17 ½s¿è

§Ú¥´¶}  visual basic 2008 Express ¦p¹Ï,¦bÀ˵ø­¶¦³¸ê®Æ®wÁ`ºÞ¿ï¶µ

¥¼©R¦W.JPG (413.81 KB)

¥¼©R¦W.JPG

TOP

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-16 06:21 ½s¿è

§Ú­Ì¦b¸ê®ÆÁ`ºÞ¤¤¦³¸ê®Æ³sµ²,¦b¸ê®Æ³sµ²¤W¥Î¦Ñ¹«ÂI¥kÁä·|¥X²{§ÖÅã¥\¯àªí,¿ï¨ú¥[¤J¸ê®Æ³sµ²

¥¼©R¦W.JPG (39.45 KB)

¥¼©R¦W.JPG

TOP

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-16 12:30 ½s¿è

¥X²{µøµ¡«á,¿ï¾Ü§Ú­Ì­nªº¸ê®Æ®w©Ò¦b¦ì¸m,·íµM§Úªº©M§O¤H¤@©w·|¦³©Ò¤£¦P
µM«á¥i¥H«ö´ú¸Õ³s½u¶s,§Ú±Ä¥Îªº´ú¬O¬Osql sever ªº¥_­·¸ê®Æ®w ,¤@¯ëªº¸ê®Æ®wdemo ¤j³£·|§Q¥Î³o­Ó¨Ó°µ

¥¼©R¦W.JPG (149.4 KB)

¥¼©R¦W.JPG

TOP

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-19 13:36 ½s¿è

·íµM³o¬O¤@ºØ³s±µ¤è¦¡
¥t¤@ºØ¬O¼gµ{¦¡ ,§Ú­Ì ·s¼W¤@­Ówindowsform ±M®×,µM«á¦bªí³æ¤W­±·s¼W¤G­Ó«ö¶s
Áä¤J¥H¤Uµ{¦¡½X
  1. Imports System.Data.SqlClient
  2. Public Class Form1

  3.     Private CN As SqlConnection

  4.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


  5.         CN = New SqlConnection
  6.         CN.ConnectionString = "Data Source =.\SQLEXPRESS;" & _
  7.                               "AttachDbFilename=D:\NorthWind\NORTHWND.MDF;" & _
  8.                               "Integrated Security=True;Connect Timeout=30;User Instance=True"
  9.         CN.Open()
  10.         MessageBox.Show("¸ê®Æ®w¶}啓")


  11.     End Sub


  12.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

  13.         CN.Close()
  14.         CN.Dispose()
  15.         MessageBox.Show("¸ê®ÆÃö³¬")
  16.     End Sub

  17. End Class
½Æ»s¥N½X
·í§Ú­Ì­n¶}sql¸ê®Æ®w®É,­n§Q¥Î System.Data.SqlClient¦WºÙªÅ¶¡¤UªºSqlConnectionª«¥ó
³o­Óª«¥ó¶}啓¸ê®Æ®w¤§«e,­nµ¹¥L¤@­Ó³s½u¦r¦ê ConnectionString  , §Úªº³s½u¦r¦ê¤@¯ë¤£·|©M
¨ä¥L¤H¬Û¦P,µM«á§Ú­Ì´N¥i¥H¥Î Open ¤èªk¨Ó¶}啓
³Ì«á ¸ê®Æ®w¥Î§¹®É,§O§Ñ¤F­nÃö±¼,©Ò¥H«ö¶s2´N¬O­t³dÃö³¬¸ê®Æ®w³s½u ¨ÃÄÀ©ñ¸ê·½

TOP

¥»©«³Ì«á¥Ñ §b§b ©ó 2011-2-19 19:50 ½s¿è

sqlConnection¦³¤@­ÓStateChange¨Æ¥ó
¥¦¦³¤@­Ó¶Ç»¼ªº°Ñ¼Æe¥i¥H§i¶D§A©Ò¥Îªº¸ê®Æ®w³s½uª¬ºA
¦pªG§Ú­Ì§âµ{¦¡½X§ï¦¨¦p¤U,¬d¬Ý±¡ªp
  1. Imports System.Data.SqlClient


  2. Public Class Form1

  3.     Private CN As SqlConnection

  4.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


  5.         CN = New SqlConnection
  6.         CN.ConnectionString = "Data Source =.\SQLEXPRESS;" & _
  7.                               "AttachDbFilename=D:\NorthWind\NORTHWND.MDF;" & _
  8.                               "Integrated Security=True;Connect Timeout=30;User Instance=True"

  9.         AddHandler CN.StateChange, AddressOf CNOnStateChanging
  10.         CN.Open()
  11.         MessageBox.Show("¸ê®Æ®w¶}啓")


  12.     End Sub


  13.     Private Sub CNOnStateChanging(ByVal sender As Object, ByVal e As System.Data.StateChangeEventArgs)

  14.         MessageBox.Show(e.CurrentState.ToString)

  15.     End Sub

  16.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

  17.         CN.Close()
  18.         CN.Dispose()
  19.         MessageBox.Show("¸ê®ÆÃö³¬")
  20.     End Sub

  21. End Class
½Æ»s¥N½X

TOP

§Ú­Ì¤w¸g³s¤W¸ê®Æ®w¤F,
¦ý§Ú­Ì­n¦p¦óŪ¨ú,½s¿è¸ê®Æ®w¤Wªº¸ê®Æ©O
ado.net µ¹¤F§Ú­Ì¤@­Ó«Ü²³æªºª«¥ó¨Ó°µ³o¥ó¨Æ
´N¬Ocommandª«¥ó

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¨S¦³©Ò¦³Åv¡A¥u¦³¥Í©Rªº¨Ï¥ÎÅv¡C
ªð¦^¦Cªí ¤W¤@¥DÃD