public Form1() { // // Required for Windows Form Designer support // InitializeComponent();
// // TODO: Add any constructor code after InitializeComponent call // }
public static void Form2(string[] args) { MySqlConnection con = new MySqlConnection("Database=vipit_vipit;Data Source=mydb1.surftown.dk;User Id=vipit;Password=5967HLLX"); con.Open(); MySqlCommand sel = new MySqlCommand("SELECT * FROM T1", con); MySqlDataReader rdr = sel.ExecuteReader(); while(rdr.Read()) { Console.WriteLine(rdr[0] + " " + rdr[1]); } rdr.Close(); con.Close(); }
/// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); }
#region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.dataView1 = new System.Data.DataView(); ((System.ComponentModel.ISupportInitialize)(this.dataView1)).BeginInit(); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(552, 358); this.Name = "Form1"; this.Text = "VipIT Connected"; ((System.ComponentModel.ISupportInitialize)(this.dataView1)).EndInit();
} #endregion
/// <summary> /// The main entry point for the application. /// </summary> //[STAThread] static void Main() { //Application.Run(new Form1()); Application.Run(new Form2()); } } }
Får fejlen
(91): 'Connected.Form1.Form2()' denotes a 'method' where a 'class' was expected
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.