CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  .NET技术 >  VB.NET

帮忙看1下到底错哪里啦

楼主bennyparlo(流星の轨迹)2005-06-02 11:46:16 在 .NET技术 / VB.NET 提问

 
  Public   Class   Form1  
          Inherits   System.Windows.Forms.Form  
   
          Private   strConn   As   String   =   "user   id=sa;data   source=SU;persist   security   info=False;initial   catalog=Northwind"  
          Private   Conn   As   SqlClient.SqlConnection   =   New   System.Data.SqlClient.SqlConnection(strConn)  
   
   
  #Region   "   Windows   Form   Designer   generated   code   "  
   
          Public   Sub   New()  
                  MyBase.New()  
   
                  'This   call   is   required   by   the   Windows   Form   Designer.  
                  InitializeComponent()  
   
                  'Add   any   initialization   after   the   InitializeComponent()   call  
   
          End   Sub  
   
          'Form   overrides   dispose   to   clean   up   the   component   list.  
          Protected   Overloads   Overrides   Sub   Dispose(ByVal   disposing   As   Boolean)  
                  If   disposing   Then  
                          If   Not   (components   Is   Nothing)   Then  
                                  components.Dispose()  
                          End   If  
                  End   If  
                  MyBase.Dispose(disposing)  
          End   Sub  
   
          'Required   by   the   Windows   Form   Designer  
          Private   components   As   System.ComponentModel.IContainer  
   
          'NOTE:   The   following   procedure   is   required   by   the   Windows   Form   Designer  
          'It   can   be   modified   using   the   Windows   Form   Designer.      
          'Do   not   modify   it   using   the   code   editor.  
          Friend   WithEvents   DataGrid1   As   System.Windows.Forms.DataGrid  
          Friend   WithEvents   Button1   As   System.Windows.Forms.Button  
          Friend   WithEvents   Button2   As   System.Windows.Forms.Button  
          Friend   WithEvents   Button3   As   System.Windows.Forms.Button  
          Friend   WithEvents   Button4   As   System.Windows.Forms.Button  
          <System.Diagnostics.DebuggerStepThrough()>   Private   Sub   InitializeComponent()  
                  Me.DataGrid1   =   New   System.Windows.Forms.DataGrid  
                  Me.Button1   =   New   System.Windows.Forms.Button  
                  Me.Button2   =   New   System.Windows.Forms.Button  
                  Me.Button3   =   New   System.Windows.Forms.Button  
                  Me.Button4   =   New   System.Windows.Forms.Button  
                  CType(Me.DataGrid1,   System.ComponentModel.ISupportInitialize).BeginInit()  
                  Me.SuspendLayout()  
                  '  
                  'DataGrid1  
                  '  
                  Me.DataGrid1.DataMember   =   ""  
                  Me.DataGrid1.HeaderForeColor   =   System.Drawing.SystemColors.ControlText  
                  Me.DataGrid1.Location   =   New   System.Drawing.Point(56,   32)  
                  Me.DataGrid1.Name   =   "DataGrid1"  
                  Me.DataGrid1.Size   =   New   System.Drawing.Size(440,   176)  
                  Me.DataGrid1.TabIndex   =   0  
                  '  
                  'Button1  
                  '  
                  Me.Button1.Location   =   New   System.Drawing.Point(80,   248)  
                  Me.Button1.Name   =   "Button1"  
                  Me.Button1.Size   =   New   System.Drawing.Size(72,   24)  
                  Me.Button1.TabIndex   =   1  
                  Me.Button1.Text   =   "View"  
                  '  
                  'Button2  
                  '  
                  Me.Button2.Location   =   New   System.Drawing.Point(184,   248)  
                  Me.Button2.Name   =   "Button2"  
                  Me.Button2.Size   =   New   System.Drawing.Size(64,   24)  
                  Me.Button2.TabIndex   =   2  
                  Me.Button2.Text   =   "Add"  
                  '  
                  'Button3  
                  '  
                  Me.Button3.Location   =   New   System.Drawing.Point(288,   248)  
                  Me.Button3.Name   =   "Button3"  
                  Me.Button3.Size   =   New   System.Drawing.Size(64,   24)  
                  Me.Button3.TabIndex   =   3  
                  Me.Button3.Text   =   "Update"  
                  '  
                  'Button4  
                  '  
                  Me.Button4.Location   =   New   System.Drawing.Point(392,   248)  
                  Me.Button4.Name   =   "Button4"  
                  Me.Button4.Size   =   New   System.Drawing.Size(64,   24)  
                  Me.Button4.TabIndex   =   4  
                  Me.Button4.Text   =   "Delete"  
                  '  
                  'Form1  
                  '  
                  Me.AutoScaleBaseSize   =   New   System.Drawing.Size(5,   13)  
                  Me.ClientSize   =   New   System.Drawing.Size(536,   309)  
                  Me.Controls.Add(Me.Button4)  
                  Me.Controls.Add(Me.Button3)  
                  Me.Controls.Add(Me.Button2)  
                  Me.Controls.Add(Me.Button1)  
                  Me.Controls.Add(Me.DataGrid1)  
                  Me.MaximizeBox   =   False  
                  Me.Name   =   "Form1"  
                  Me.StartPosition   =   System.Windows.Forms.FormStartPosition.CenterScreen  
                  Me.Text   =   "Form1"  
                  CType(Me.DataGrid1,   System.ComponentModel.ISupportInitialize).EndInit()  
                  Me.ResumeLayout(False)  
   
          End   Sub  
   
  #End   Region  
   
          Private   Sub   DataGrid1_Navigate(ByVal   sender   As   System.Object,   ByVal   ne   As   System.Windows.Forms.NavigateEventArgs)  
   
          End   Sub  
   
          Private   Sub   Form1_Load(ByVal   sender   As   System.Object,   ByVal   e   As   System.EventArgs)   Handles   MyBase.Load  
   
                  'DataGrid   init  
   
   
   
                  'Database   connect  
                  On   Error   GoTo   ErrHandle  
   
                  Conn.Open()  
   
  ErrHandle:  
                  MsgBox(Err.Description   +   "Database   connection   Error!!")  
          End   Sub  
   
  End   Class  
   
   
  为什么总联不上去呢?  
  问题点数:15、回复次数:3Top

1 楼lovefootball(蟑螂(生活就是扯淡--做人要放低姿态))回复于 2005-06-02 12:26:00 得分 5

connection   string   的问题Top

2 楼zhangzhijian(逍遥||淡水鱼)回复于 2005-06-02 14:06:44 得分 5

strSql="Integrated   Security=SSPI;   Initial   Catalog=dtaDatabaseName;Data   Source=computername;Workstation   ID=computername"Top

3 楼ferrari1231()回复于 2005-06-02 14:19:33 得分 5

strSql="Integrated   Security=SSPI;   Initial   Catalog=dtaDatabaseName;Data   Source=数据库存放的主机名或ip地址;Workstation   ID=computername"  
  Top

相关问题

  • 到底哪里错?
  • 到底是哪里的错?
  • 到底哪里出错了?
  • 到底出错在哪里???????
  • 到底错哪里了??
  • 到底错在哪里????
  • 高手请进来帮我看看我到底哪里错了?
  • 帮我看看,到底错在哪里呢?
  • ★各位前辈帮忙看看我到底哪里搞错了!!!
  • 大家帮我看看,这段代码,到底错在哪里?~

关键词

  • me
  • datagrid
  • security
  • source
  • button
  • drawing
  • disposing
  • tabindex
  • friend withevents
  • computername

得分解答快速导航

  • 帖主:bennyparlo
  • lovefootball
  • zhangzhijian
  • ferrari1231

相关链接

  • CSDN .NET频道
  • .NET类图书
  • C#类图书
  • .NET类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo