In interview, mostly question asked by the Technical HR will be relate to form applicaton apllication. To develop any software one should know how to create create store procedure. In this we have created one small application which may help you to understand the basic concept how to develop an application.
Login proc CREATE PROCEDURE [dbo].[login_proc] ( @UserId varchar(50), @User_Password varchar(50) ) AS Begin Select @UserId from Emp_Login where UserId=@UserId and User_Password=@User_Password END
Proc_std_Delete CREATEPROCEDURE [dbo].[Proc_std_Delete] ( @Enrollment_number int ) AS BEGIN IFNOTEXISTS(SELECT Enrollment_number FROM
Std_Details where
Enrollment_number = @Enrollment_number) begin print'Data does not exist or
Enrollemt Id is wrong'; end else begin deletefrom Std_Details where Enrollment_number =
@Enrollment_number print'Deleted record successfully'; end end
ALTERPROCEDURE [dbo].[Proc_std_Info] ( @Enrollment_number int, @Student_name varchar(50), @Father_Name varchar(50), @Mother_Name varchar(50), @Sex varchar(50), @Permanent_Add varchar(50), @Permanent_State varchar(50), @Subject_Maths varchar(30), @Subject_Physics varchar(30), @Subject_Chemistry varchar(30), @Subject_English varchar(30), @Subject_Hindi varchar(30), @Subject_Social varchar(30), @class varchar(30) ) AS BEGIN IFNOTEXISTS(SELECT Enrollment_number FROM
Std_Details where
Enrollment_number = @Enrollment_number) BEGIN INSERTINTO Std_Details(Enrollment_number,[Student_name],[Father_Name],[Mother_Name],[Sex],[Permanent_Add],[Permanent_State]) values (@Enrollment_number,@Student_name,@Father_Name,@Mother_Name,@Sex,@Permanent_Add,@Permanent_State) INSERTINTO Std_Opt_Sub(Enrollment_number,[Subject_Maths],[Subject_Physics],[Subject_Chemistry],[Subject_English],[Subject_Hindi],[Subject_Social],[Opt_Begin_Date],[Opt_End_Date],[class]) values (@Enrollment_number,@Subject_Maths,@Subject_Physics,@Subject_Chemistry,@Subject_English,@Subject_Hindi,@Subject_Social,GETDATE(),'2299-12-31',@class) END else begin print'Data already exist'; end end
ALTERPROCEDURE [dbo].[Proc_std_Update] ( @Enrollment_number int, @Student_name varchar(50), @Father_Name varchar(50), @Mother_Name varchar(50), @Sex varchar(50), @Permanent_Add varchar(50), @Permanent_State varchar(50), @Subject_Maths varchar(30), @Subject_Physics varchar(30), @Subject_Chemistry varchar(30), @Subject_English varchar(30), @Subject_Hindi varchar(30), @Subject_Social varchar(30), @class varchar(30) ) AS BEGIN IFNOTEXISTS(SELECT Enrollment_number FROM
Std_Details where
Enrollment_number = @Enrollment_number) begin print'Data does not exist or
Enrollemt Id is wrong'; end else begin Update Std_Details set Student_name= @Student_name, Father_Name=@Father_Name, Mother_Name=@Mother_Name, Sex=@Sex, Permanent_Add=@Permanent_Add, Permanent_State=@Permanent_State where Enrollment_number =
@Enrollment_number Update Std_Opt_Sub set Subject_Maths=@Subject_Maths , Subject_Physics=@Subject_Physics
, Subject_Chemistry=@Subject_Chemistry
, Subject_English=@Subject_English
, Subject_Hindi=@Subject_Hindi, Subject_Social=@Subject_Social, Class=@class where Enrollment_number =
@Enrollment_number end end
ALTERPROCEDURE [dbo].[Proc_user_insert] ( @UserId varchar (30), @User_Password VARCHAR (100), @Name varchar(30), @Password_Hint varchar(30) ) AS BEGIN IFNOTEXISTS(SELECT UserId FROM
User_information where @UserId = UserId) begin insertinto
User_information([UserId],[User_Password],[Name],[Password_Hint]) values (@UserId, @User_Password,@Name,@Password_Hint) print'Data Inserted
Successfully'; end else begin print'Data Already Exist'; end end
ALTERPROCEDURE [dbo].[Proc_user_insert1] ( @UserId varchar (30), @User_Password varchar (100), @Name varchar(30), @Password_Hint varchar(30) ) AS BEGIN IFNOTEXISTS(SELECT UserId FROM
User_information where @UserId = UserId) begin insertinto
User_information([UserId],[User_Password],[Name],[Password_Hint]) values (@UserId,HASHBYTES('SHA2_512',@User_Password),@Name,@Password_Hint) print'Data Inserted
Successfully'; end else begin print'Data Already Exist'; end end
ALTERPROCEDURE [dbo].[User_Info] ( @UserId varchar(50), @Old_Password varchar(50), @New_Password varchar(50), @confirm_new_password varchar(50), @Password_Hint varchar(50) ) AS BEGIN IFNOTEXISTS(SELECT UserId FROM User_information where
UserId = @UserId) BEGIN PRINT'No Such
UserId Exist' END ELSE begin declare @checkpass varchar(30); set @checkpass=(SELECT User_Password
FROM User_information where UserId =
@UserId) if (@Checkpass<> @Old_Password) begin print'old password is wrong' end ELSE IF (@New_Password <> @confirm_new_password) BEGIN PRINT'Password doesn''t
match' END ELSE BEGIN UPDATE
User_information SET User_Password=
@confirm_new_password , Password_Hint= @Password_Hint WHERE UserId =
@UserId END END END
Code
for from1 using System; using
System.Collections.Generic; using
System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using
System.Windows.Forms; using
System.Data.SqlClient; namespace FormsApplication1 { publicpartialclassForm1 : Form { public Form1() { InitializeComponent(); } publicint i=0, j=0, k=0; privatevoid button1_Click(object sender, EventArgs e) {
SqlConnection
con = newSqlConnection(); con.ConnectionString = (@"Data
Source=msclient-012\sqlexpress;Initial Catalog=testing_st;User ID=sa;Password=mindstick"); con.Open(); SqlCommand cmd = newSqlCommand("Select
UserId from User_information where UserId=@UserId and
User_Password=@User_Password", con); //
SqlCommand cmd = new SqlCommand("Login_Check_Sp", con); // cmd.CommandType =
CommandType.StoredProcedure; DataTable dt = newDataTable(); cmd.Parameters.AddWithValue("@UserId", textBox1.Text); cmd.Parameters.AddWithValue("@User_Password", textBox2.Text); SqlDataReader read =
cmd.ExecuteReader(); read.Read(); if (textBox1.Text.Trim() == string.Empty) { MessageBox.Show("Userid need
to be fill","Warning
message"); i++; } else { if
(textBox2.Text.Trim() == string.Empty) { MessageBox.Show("Password
Required!!",
"Warning message"); j++; } else { if (read.HasRows) { //here you may
redirect to another page like Response.Redirect("Page2.aspx"); Form2 objfill = newForm2(); objfill.Show(); this.Hide(); con.Close(); } else { MessageBox.Show("Your UserId,
Password or both are wrong ", "Error Message"); k++; } } } if (i > 3 ) { MessageBox.Show("Attempt for
Userid Is greater than 3, please reopen","Error
Message"); this.Close(); } if ( j > 3) { MessageBox.Show("Attempt for
Password Is greater than 3, please repen and set your password","Error
Messaage"); this.Close(); } if (k>3) { MessageBox.Show("Attempt for
Password Is greater than 3, please repen and set your password","Error
Message"); this.Close(); } } privatevoid button2_Click(object sender, EventArgs e) { Form3 F3 = newForm3(); F3.Show(); } privatevoid Form1_Load(object sender, EventArgs e) { } privatevoid
textBox2_TextChanged(object sender, EventArgs e) { textBox2.MaxLength = 8; textBox2.PasswordChar = '*'; } privatevoid
textBox1_TextChanged(object sender, EventArgs e) { textBox1.MaxLength = 16; } } }
Code
for from2 using System; using
System.Collections.Generic; using
System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using
System.Threading.Tasks; using
System.Windows.Forms; using
System.Data.SqlClient; using System.Data.SqlTypes; namespace FormsApplication1 { publicpartialclassForm2 : Form { public Form2() { InitializeComponent(); } privatevoid button4_Click(object sender, EventArgs e) { this.Close(); Form1 objform1 = newForm1(); objform1.Show(); } privatevoid button1_Click(object sender, EventArgs e) { /* inserting a new details*/ SqlConnection con2 = newSqlConnection(); con2.ConnectionString = (@"Data
Source=msclient-012\sqlexpress;Initial Catalog=testing_st;User
ID=sa;Password=mindstick"); con2.Open(); SqlCommand savecom = newSqlCommand("Proc_std_Info", con2); savecom.Connection = con2; savecom.CommandType = CommandType.StoredProcedure; savecom.Parameters.AddWithValue("@Student_name", textBox2.Text); savecom.Parameters.AddWithValue("@Father_Name", textBox3.Text); savecom.Parameters.AddWithValue("@Mother_Name", textBox4.Text); if (radioButton1.Checked == true ||
radioButton2.Checked == true) { if
(radioButton1.Checked == true) { savecom.Parameters.AddWithValue("@Sex", "Male"); } else {
savecom.Parameters.AddWithValue("@Sex", "Female"); } } else { savecom.Parameters.AddWithValue("@Sex", " "); } savecom.Parameters.AddWithValue("@Permanent_Add", textBox5.Text); savecom.Parameters.AddWithValue("@Permanent_State",comboBox1.Text); int a; if (int.TryParse(textBox1.Text.ToString(), out a) ||
(textBox1.Text.Trim() == string.Empty)) { if (checkBox1.Checked
== true) {
savecom.Parameters.AddWithValue("@Subject_Maths", "Selected "); } else {
savecom.Parameters.AddWithValue("@Subject_Maths", "Not
Selected"); } if (checkBox2.Checked
== true) { savecom.Parameters.AddWithValue("@Subject_Physics", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Physics", "Not
Selected"); } if (checkBox3.Checked
== true) {
savecom.Parameters.AddWithValue("@Subject_Chemistry", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Chemistry", "Not
Selected"); } if (checkBox4.Checked
== true) {
savecom.Parameters.AddWithValue("@Subject_English", "Selected"); } else { savecom.Parameters.AddWithValue("@Subject_English", "Not
Selected"); } if (checkBox5.Checked
== true) {
savecom.Parameters.AddWithValue("@Subject_Hindi ", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Hindi", "Not
Selected"); } if (checkBox6.Checked
== true) { savecom.Parameters.AddWithValue("@Subject_Social", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Social", "Not
Selected"); } savecom.Parameters.AddWithValue("@Class", comboBox2.Text); if
(textBox1.Text.Trim() == string.Empty) { MessageBox.Show("Please enter
the User Id","Warning
message"); } else {
savecom.Parameters.AddWithValue("@Enrollment_number", Convert.ToInt32(textBox1.Text)); if
(textBox2.Text.Trim() == string.Empty) { MessageBox.Show("Please enter
Name"); } else { if
(radioButton1.Checked == false &&
radioButton2.Checked == false) { MessageBox.Show("Select male
or female",
"Warning message"); } else { if (checkBox1.Checked
== false &&
checkBox2.Checked == false &&
checkBox3.Checked == false &&
checkBox4.Checked == false &&
checkBox5.Checked == false &&
checkBox6.Checked == false) { MessageBox.Show("Select At
least one Subject",
"Warning message"); } else { SqlCommand cmd = newSqlCommand("Select
Enrollment_number from Std_Details where Enrollment_number=@UserId", con2); // SqlCommand cmd = new
SqlCommand("Login_Check_Sp", con); // cmd.CommandType =
CommandType.StoredProcedure; DataTable dt = newDataTable(); cmd.Parameters.AddWithValue("@UserId", textBox1.Text); SqlDataReader read =
cmd.ExecuteReader(); read.Read(); if (read.HasRows) { MessageBox.Show("Already Have
data ","Informational
Message"); } else { read.Close();
savecom.ExecuteNonQuery(); SqlCommand cmd1 = newSqlCommand("Select
Enrollment_number from Std_Details where Enrollment_number=@UserId", con2); //
SqlCommand cmd = new SqlCommand("Login_Check_Sp", con); // cmd.CommandType =
CommandType.StoredProcedure; DataTable dt1 = newDataTable(); cmd1.Parameters.AddWithValue("@UserId", textBox1.Text); SqlDataReader read1 =
cmd1.ExecuteReader();
read1.Read(); if (read1.HasRows) { MessageBox.Show("Inserted
Successfully",
"Congrats!!!"); } else { MessageBox.Show("Enrollement
Id Is not valid",
"Error Message"); } } } } } } } else { MessageBox.Show("Please enter
the correct format of enrollment id","Warning message"); } con2.Close(); } privatevoid button2_Click(object sender, EventArgs e) { /* inserting a new details*/ SqlConnection con3 = newSqlConnection(); con3.ConnectionString = (@"Data
Source=msclient-012\sqlexpress;Initial Catalog=testing_st;User
ID=sa;Password=mindstick"); con3.Open(); SqlCommand savecom = newSqlCommand("Proc_std_Update", con3); savecom.Connection = con3; savecom.CommandType = CommandType.StoredProcedure; savecom.Parameters.AddWithValue("@Student_name", textBox2.Text); savecom.Parameters.AddWithValue("@Father_Name", textBox3.Text); savecom.Parameters.AddWithValue("@Mother_Name", textBox4.Text); if (radioButton1.Checked == true ||
radioButton2.Checked == true) { if
(radioButton1.Checked == true) {
savecom.Parameters.AddWithValue("@Sex", "Male"); } else { savecom.Parameters.AddWithValue("@Sex", "Female"); } } else {
savecom.Parameters.AddWithValue("@Sex", " "); } savecom.Parameters.AddWithValue("@Permanent_Add", textBox5.Text); savecom.Parameters.AddWithValue("@Permanent_State", comboBox1.Text); int a; if (int.TryParse(textBox1.Text.ToString(), out a) ||
(textBox1.Text.Trim() == string.Empty)) { if (checkBox1.Checked
== true) { savecom.Parameters.AddWithValue("@Subject_Maths", "Selected
"); } else {
savecom.Parameters.AddWithValue("@Subject_Maths", "Not
Selected"); } if (checkBox2.Checked == true) {
savecom.Parameters.AddWithValue("@Subject_Physics", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Physics", "Not
Selected"); } if (checkBox3.Checked == true) {
savecom.Parameters.AddWithValue("@Subject_Chemistry", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Chemistry", "Not
Selected"); } if (checkBox4.Checked == true) { savecom.Parameters.AddWithValue("@Subject_English", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_English", "Not
Selected"); } if (checkBox5.Checked == true) { savecom.Parameters.AddWithValue("@Subject_Hindi
",
"Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Hindi", "Not
Selected"); } if (checkBox6.Checked == true) {
savecom.Parameters.AddWithValue("@Subject_Social", "Selected"); } else {
savecom.Parameters.AddWithValue("@Subject_Social", "Not
Selected"); } savecom.Parameters.AddWithValue("@Class", comboBox2.Text); if (textBox1.Text.Trim() == string.Empty) { MessageBox.Show("Please enter
the User Id",
"Warning message"); } else { savecom.Parameters.AddWithValue("@Enrollment_number", Convert.ToInt32(textBox1.Text)); if
(textBox2.Text.Trim() == string.Empty) { MessageBox.Show("Please enter
Name",
"Warning message"); } else { if
(radioButton1.Checked == false &&
radioButton2.Checked == false) { MessageBox.Show("Select male
or female",
"Warning message"); } else { if (checkBox1.Checked
== false &&
checkBox2.Checked == false &&
checkBox3.Checked == false &&
checkBox4.Checked == false &&
checkBox5.Checked == false &&
checkBox6.Checked == false) { MessageBox.Show("Select At
least one Subject",
"Warning message"); } else { savecom.ExecuteNonQuery(); SqlCommand cmd = newSqlCommand("Select
Enrollment_number from Std_Details where Enrollment_number=@UserId", con3); // SqlCommand cmd = new
SqlCommand("Login_Check_Sp", con); // cmd.CommandType =
CommandType.StoredProcedure; DataTable dt = newDataTable();
cmd.Parameters.AddWithValue("@UserId", textBox1.Text); SqlDataReader read =
cmd.ExecuteReader(); read.Read(); if (read.HasRows) { MessageBox.Show("Updated
Successfully",
"Congrats!!!"); } else { MessageBox.Show("Enrollement
Id Is not valid",
"Error Message"); } } } } } } else { MessageBox.Show("Please enter
the correct format of enrollment id", "Warning message"); } con3.Close(); } privatevoid button5_Click(object sender, EventArgs e) { Form4 f4 = newForm4(); f4.Show(); f4.fill(); } privatevoid button3_Click(object sender, EventArgs e) { SqlConnection con6 = newSqlConnection(); con6.ConnectionString = (@"Data
Source=msclient-012\sqlexpress;Initial Catalog=testing_st;User
ID=sa;Password=mindstick"); con6.Open(); SqlCommand DeleteCom = newSqlCommand("Proc_std_Delete", con6); DeleteCom.Connection = con6; DeleteCom.CommandType = CommandType.StoredProcedure; int a; if (int.TryParse(textBox1.Text.ToString(), out a) || (textBox1.Text.Trim()
== string.Empty)) {
DeleteCom.Parameters.AddWithValue("@Enrollment_number", textBox1.Text); SqlCommand cmd = newSqlCommand("Select
Enrollment_number from Std_Details where Enrollment_number=@UserId", con6); // SqlCommand cmd = new
SqlCommand("Login_Check_Sp", con); // cmd.CommandType =
CommandType.StoredProcedure; DataTable dt = newDataTable(); cmd.Parameters.AddWithValue("@UserId", textBox1.Text); SqlDataReader read =
cmd.ExecuteReader(); read.Read(); if (read.HasRows) { DialogResult result2 = MessageBox.Show("Are you sure
do you want to delete", "Question", MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Question); if (result2 == DialogResult.Yes) { read.Close();
DeleteCom.ExecuteNonQuery(); MessageBox.Show("Deleted
Successfully"); this.Close(); Form1 objlogin = newForm1(); objlogin.Show(); } else { MessageBox.Show("No Account
has been updated ",
"Informational Message"); } } else { MessageBox.Show("Enrollement
Id Is not valid or Already Deleted","Informatinal Error"); } } else { MessageBox.Show("Enrollement
Id Format is not correct"); } con6.Close(); } publicvoid textBox1_TextChanged(object sender, EventArgs e) { textBox1.MaxLength = 8; } publicvoid textBox2_TextChanged(object sender, EventArgs e) { textBox2.MaxLength = 16; } publicvoid textBox3_TextChanged(object sender, EventArgs e) { textBox3.MaxLength = 16; } publicvoid textBox4_TextChanged(object sender, EventArgs e) { textBox4.MaxLength = 16; } publicvoid textBox5_TextChanged(object sender, EventArgs e) { textBox5.MaxLength = 20; } publicvoid comboBox1_SelectedIndexChanged(object sender, EventArgs e) { } publicvoid Form2_Load(object sender, EventArgs e) { SqlConnection concombostate = newSqlConnection(); concombostate.ConnectionString = (@"Data
Source=msclient-012\sqlexpress;Initial Catalog=testing_st;User
ID=sa;Password=mindstick"); concombostate.Open(); SqlCommand sc = newSqlCommand("select
List_of_state from Indian_state", concombostate); SqlDataReader reader; reader = sc.ExecuteReader(); DataTable dt = newDataTable(); dt.Columns.Add("List_of_state", typeof(string)); dt.Load(reader); comboBox1.DisplayMember = "List_of_state"; comboBox1.DataSource = dt; // concombostate.Close(); comboBox1.SelectedIndex = -1; }
} }
Code for form3
using System; using
System.Collections.Generic; using
System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using
System.Threading.Tasks; using
System.Windows.Forms; using
System.Data.SqlClient; namespace FormsApplication1 { publicpartialclassForm3 : Form { public Form3() { InitializeComponent(); } privatevoid button1_Click(object sender, EventArgs e) { SqlConnection con = newSqlConnection(); con.ConnectionString = (@"Data
Source=msclient-012\sqlexpress;Initial Catalog=testing_st;User
ID=sa;Password=mindstick"); con.Open(); SqlCommand cmdreset = newSqlCommand("User_Info", con); cmdreset.Connection = con; cmdreset.CommandType = CommandType.StoredProcedure; cmdreset.Parameters.AddWithValue("@Old_Password", textBox1.Text); cmdreset.Parameters.AddWithValue("@UserId", textBox5.Text); cmdreset.Parameters.AddWithValue("@New_Password", textBox2.Text); cmdreset.Parameters.AddWithValue("@confirm_new_password", textBox3.Text); cmdreset.Parameters.AddWithValue("@Password_Hint", textBox4.Text); if (textBox5.Text.Trim() == string.Empty) { MessageBox.Show("Userid
required","Warning
Message"); } else { if
(textBox1.Text.Trim() == string.Empty) { MessageBox.Show("Old Password
Required!!","Warning
Message"); } else { if
(textBox2.Text.Trim() == string.Empty) { MessageBox.Show("New password
required","Warning
Message"); } else { if
(textBox3.Text.Trim() == string.Empty) { MessageBox.Show("Confirm
Password Required","Warning
Message"); } else {
cmdreset.ExecuteNonQuery(); SqlCommand cmd = newSqlCommand("Select
UserId from User_information where UserId=@UserId and User_Password=@User_Password", con); // SqlCommand cmd = new
SqlCommand("Login_Check_Sp", con); // cmd.CommandType =
CommandType.StoredProcedure; DataTable dt = newDataTable(); cmd.Parameters.AddWithValue("@UserId", textBox5.Text);
cmd.Parameters.AddWithValue("@User_Password", textBox2.Text); SqlDataReader read =
cmd.ExecuteReader(); read.Read(); if (read.HasRows) { //here you may
redirect to another page like Response.Redirect("Page2.aspx"); MessageBox.Show("Successfully
changed the Password ","Contrats Message"); read.Close(); this.Close(); } else { read.Close(); SqlCommand cmd1 = newSqlCommand("Select
UserId from User_information where UserId=@UserId and
User_Password=@User_Password", con); // SqlCommand cmd = new SqlCommand("Login_Check_Sp",
con); // cmd.CommandType =
CommandType.StoredProcedure; DataTable dt1 = newDataTable();
cmd1.Parameters.AddWithValue("@UserId", textBox5.Text);
cmd1.Parameters.AddWithValue("@User_Password", textBox1.Text); SqlDataReader read1 =
cmd1.ExecuteReader(); read1.Read(); if (read1.HasRows) { //here you may
redirect to another page like Response.Redirect("Page2.aspx"); MessageBox.Show("Password
mismatich ","Warning
Message");
read1.Close(); } else { MessageBox.Show("Old Password
is wrong","Warning
Message"); } } con.Close(); } } } } } privatevoid button2_Click (object sender, EventArgs e) { this.Close(); } privatevoid
textBox1_TextChanged(object sender, EventArgs e) { textBox1.PasswordChar = '*'; textBox1.MaxLength = 8; } privatevoid
textBox2_TextChanged(object sender, EventArgs e) { textBox2.PasswordChar = '*'; textBox2.MaxLength = 8; } privatevoid
textBox3_TextChanged(object sender, EventArgs e) { textBox3.PasswordChar = '*'; textBox3.MaxLength = 8; } } }
Code for form4
using System; using
System.Collections.Generic; using
System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using
System.Threading.Tasks; using
System.Windows.Forms; using
System.Data.SqlClient; using
System.Data.SqlTypes; namespace FormsApplication1 { publicpartialclassForm4 : Form { public Form4() { InitializeComponent(); } publicvoid fill() { SqlConnection con3 = newSqlConnection(); con3.ConnectionString = (@"Data
Source=msclient-012\sqlexpress;Initial Catalog=testing_st;User
ID=sa;Password=mindstick"); DataSet ds = newDataSet(); con3.Open(); SqlCommand cmd = newSqlCommand("select
A.Enrollment_number,A.Student_name,A.Father_Name,A.Mother_Name,A.Sex,A.Permanent_Add,A.Permanent_State,B.Subject_Maths,B.Subject_Physics,B.Subject_Chemistry,B.Subject_English,B.Subject_Hindi,B.Subject_Social,B.class
FROM Std_Details A,Std_Opt_Sub B where A.Enrollment_number =
B.Enrollment_number",
con3); SqlDataAdapter da = newSqlDataAdapter(); da.SelectCommand = cmd; da.Fill(ds); dataGridView1.DataSource =
ds.Tables[0]; } publicvoid dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { // string profilename =
dataGridView1.Rows[0].Cells[1].Value.ToString(); // int a; // int.TryParse(profilename, out a); //
Form2 f2 = new Form2(); //
f2.textBox1.Text = profilename; } publicvoid dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { /* Form2 f2 = new Form2(); f2.textBox1.Text =
dataGridView1.CurrentRow.Cells["Enrollment_number"].Value.ToString(); this.Close();*/ } } }
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
In interview, mostly question asked by the Technical HR will be relate to form applicaton apllication. To develop any software one should know how to create create store procedure. In this we have created one small application which may help you to understand the basic concept how to develop an application.
Code for form3
Code for form4