السلام عليكم ورحمة الله وبركاته
اخواني الكرام بعد محاولات مضنية نجحت ولله الحمد في عمل تصميم لمشروعي في الكليه حول الادو دوت نت عن شركة مصر للطيران من خلال الدروس والشروحات التي وجدتها في المنتدى , ولكن تصادفني هذه الرسالة دوما ولا اقدر على ادخال اي بيانات من بعدها , وهذه صور المشكلة .


مع اني نزلت اخر اصدار للفريم وورك فيرجن 2
وهذا هو الكود المستخدم
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
namespace EgyptAir
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Data.SqlClient.SqlConnection Con;
private System.Windows.Forms.TextBox editPassword;
private System.Windows.Forms.TextBox editUserID;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.editUserID = new System.Windows.Forms.TextBox();
this.editPassword = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Silver;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.label1.Location = new System.Drawing.Point(160, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(264, 32);
this.label1.TabIndex = 0;
this.label1.Text = "Egypt Air Booking Program";
//
// label2
//
this.label2.BackColor = System.Drawing.Color.Silver;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.label2.Location = new System.Drawing.Point(56, 272);
this.label2.Name = "label2";
this.label2.TabIndex = 1;
this.label2.Text = "User Name";
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// label3
//
this.label3.BackColor = System.Drawing.Color.Silver;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.label3.Location = new System.Drawing.Point(56, 328);
this.label3.Name = "label3";
this.label3.TabIndex = 2;
this.label3.Text = "Password";
//
// editUserID
//
this.editUserID.Location = new System.Drawing.Point(192, 272);
this.editUserID.Name = "editUserID";
this.editUserID.Size = new System.Drawing.Size(152, 20);
this.editUserID.TabIndex = 3;
this.editUserID.Text = "";
this.editUserID.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// editPassword
//
this.editPassword.Location = new System.Drawing.Point(192, 328);
this.editPassword.Name = "editPassword";
this.editPassword.PasswordChar = '*';
this.editPassword.Size = new System.Drawing.Size(152, 20);
this.editPassword.TabIndex = 4;
this.editPassword.Text = "";
this.editPassword.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Silver;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.button1.Location = new System.Drawing.Point(200, 416);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(104, 48);
this.button1.TabIndex = 5;
this.button1.Text = "Reseat";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.Silver;
this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.button2.Location = new System.Drawing.Point(56, 416);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(104, 48);
this.button2.TabIndex = 4;
this.button2.Text = "Login";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.BackColor = System.Drawing.Color.Silver;
this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.button3.Location = new System.Drawing.Point(352, 416);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(104, 48);
this.button3.TabIndex = 5;
this.button3.Text = "Exit";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(692, 502);
this.Controls.Add(this.button1);
this.Controls.Add(this.editPassword);
this.Controls.Add(this.editUserID);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button3);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
Con.Open();
}
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
}
private void button2_Click(object sender, System.EventArgs e)
{
SqlCommand cmd=Con.CreateCommand();
string Sql="SELECT *,tblogin.* FROM tblogin WHERE (UserID = '"+ editUserID +"') AND (Password ='" + editPassword.Text +"')";
cmd.CommandText=Sql;
SqlDataReader rdr=cmd.ExecuteReader();
if(rdr.Read())
{
MessageBox.Show(" Access Accept ");
this.Hide();
Form2 form2 = new Form2();
form2.Show();
}
else
{
MessageBox.Show("Access Deniy");
}
rdr.Close();
}
private void textBox2_TextChanged(object sender, System.EventArgs e)
{
}
private void button3_Click(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
}
private void label2_Click(object sender, System.EventArgs e)
{
}
}
}شاكر جدا للجميع
ملحوظه للجميع :- بالفعل البحث في المنتدى يعطيك دفعه قوية جدا لابراز مواهبك , واحسن بمليون مره من ان يقوم حد بحل مسأله او مشروع لك .
تحياتي