PDA

View Full Version : مبتدی: اعتبارسنجي ونمايش اطلاعات



somaiebagheri
سه شنبه 19 مهر 1390, 09:50 صبح
SqlCommand newCommand = new SqlCommand();
SqlConnection newconnection = new SqlConnection("data source=;initial catalog=kouft;intregrated security=true");
newCommand.CommandText="select code,pass from Table_1 where code="textBox1.Text" and pass="textBox2.Text" ";
if (newCommand.CommandText!=null);
newCommand.Connection=newconnection;
newCommand.Connection.Open();
SqlDataAdapter da=new SqlDataAdapter(newCommand);
DataSet ds=new DataSet();
da.Fill(ds);
dataGridView1.DataSource=ds.Tables[0];
else (label3.Visible==true);
من ميخوام با زدن دكمه ورود كدكاربري ورمز چك شود واگه درست بود اطلاعات نمايش داده شود واگه درست نبود يك پيغاخطا نمايش داده شود.