TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kamal dhillon
NA
23
13.9k
why i cant store values in database ???? my code is correct is correct when i debugging my program then it implemented but not displayed in the database
Sep 26 2012 3:00 PM
public partial class Form8registration : Form
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
public Form8registration()
{
InitializeComponent();
}
private void linkLabel1_login_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Form1 fm1 = new Form1();
fm1.Show();
this.Hide();
}
private void Form8registration_Load(object sender, EventArgs e)
{
conn.Open();
}
private void button2_reset_Click(object sender, EventArgs e)
{
Reset();
}
private void Reset()
{
textBox1_add.Text = "";
textBox3_phoneno.Text = "";
textBox4_emailid.Text = "";
textBox5_desgination.Text = "";
textBox6_name.Text = "";
textBox7_empid.Text = "";
comboBox1_shifttime.SelectedText = "";
textBox1_skpid.Text = "";
}
private void button3_cancel_Click(object sender, EventArgs e)
{
Close();
}
private void button1_submit_Click(object sender, EventArgs e)
{
if (conn.State == ConnectionState.Closed)
{
conn.Open();
}
SqlCommand cmdd = new SqlCommand("registrtn", conn);
cmdd.CommandType = CommandType.StoredProcedure;
cmdd.Connection = conn;
cmdd.Parameters.Add("@empid",SqlDbType.VarChar, 50).Value = textBox7_empid.Text;
cmdd.Parameters.Add("@empname", SqlDbType.VarChar, 50).Value = textBox6_name.Text;
cmdd.Parameters.Add("@desgination", SqlDbType.VarChar, 50).Value = textBox5_desgination.Text;
cmdd.Parameters.Add("@emailid", SqlDbType.VarChar, 50).Value = textBox4_emailid.Text;
cmdd.Parameters.Add("@phone", SqlDbType.VarChar, 50).Value = textBox3_phoneno.Text;
cmdd.Parameters.Add("@skype", SqlDbType.VarChar, 50).Value = textBox1_skpid.Text;
cmdd.Parameters.Add("@address", SqlDbType.VarChar, 50).Value = textBox1_add.Text;
cmdd.Parameters.Add("@shifttime", SqlDbType.VarChar, 50).Value = comboBox1_shifttime.SelectedText;
cmdd.Parameters.Add("@panel", SqlDbType.VarChar, 50).Value = radioButton1_employe.Checked.ToString();
cmdd.ExecuteNonQuery();
cmdd.Dispose();
conn.Close();
Reset();
}
}
}
Reply
Answers (
2
)
Define How to Anonymous function return value
how to store date time values in database and also i want to store screenshot pictures in particular folder ????