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
Shah Shishir
NA
4
0
object reference not set to an instance of an object
Oct 3 2008 5:53 AM
When write this code...
===================
/SqlConnection Connection = Connection.Open();
SqlCommand Comm = new SqlCommand();
//Comm.Connection = Conn;
Comm.CommandType = CommandType.Text;
Comm.CommandText = "Insert Into customer (Emailid,Password,Userid,Add1,State,City,Pin,Title,Fname,Lname,Gender,Dob,Mobile,Regidate) " + " values('" + txtEmailid.Text + "','" + MyPwd + "','" + txtEmailid.Text + "','" + txtAdd1.Text + "','" + cmbState.SelectedItem.Text + "','" + txtCity.Text + "'," + txtPin.Text + ",'" + CmbTitle.SelectedItem.Text + "','" + txtFname.Text + "','" + txtLname.Text + "','" + cmbGender.SelectedItem.Text + "','" + BodDate.SelectedDate.Date + "'," + txtMobile.Text + ",'" + System.DateTime.Today + "')";
Comm.ExecuteNonQuery();
//SqlConnection Connection = Connection.Close();
Adpt = new SqlDataAdapter("select * from customer", Connection);
Dataset1 = new DataSet();
Adpt.Fill(Dataset1, "customer");
EmptyControls();
================================
the insert in to qrety line in command.commantext will give this error
object reference is not set to an instance of the object
plz solve my problem as early as possible..
Thanks in advacne
Shah Shishir
Reply
Answers (
2
)
plz anybody convert my code from vb to c#
create exe with crystal report