--------------------------------------
Mam vytvorene textove pole "tpole1" a "tpole2" kde vpisujem hociaky text.
tpole1:
Kód: Vybrať všetko
this.tpole1.Location = new System.Drawing.Point(16, 88);
this.tpole1.Name = "tpole1";
this.tpole1.Size = new System.Drawing.Size(176, 20);
this.tpole1.TabIndex = 5;
this.tpole1.Text = "";Kód: Vybrať všetko
this.tpole2.Location = new System.Drawing.Point(16, 88);
this.tpole2.Name = "tpole2";
this.tpole2.Size = new System.Drawing.Size(200, 40);
this.tpole2.TabIndex = 6;
this.tpole2.Text = "";Kód: Vybrať všetko
private void button1_Click(object sender, EventArgs e)
{
string ConnectionString = ("Server=BOSSQO-LU5B62AZ;Initial Catalog=databazka24;Trusted_Connection=false;User Id=uzivatel;Password=xxxxxx;");
SqlConnection sqlConnection = new SqlConnection(ConnectionString);
SqlCommand sqlCommand = new SqlCommand("INSERT INTO
Row1 ("test1", "test2") VALUES (@test1, @test2)", sqlConnection);
sqlConnection.Open();
vloz = sqlCommand.ExecuteScalar();
sqlConnection.Close();
}//Upravene 2.7.2008 o 19:01