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
Rus Bey
NA
1
0
C# and Database (MSSQL)?
Jun 15 2007 6:01 AM
Guys i have a problem! Please help me!I want to insert data to MSSQL DB, into 1 table. Primary key id, is autoinceremented after insertion.But there i have a problem in insertCommand string. sqlSelectCommand1.CommandText = "INSERT INTO _RECORDS_INDIVIDUALS ("+ "@TRN,@Firstname,@Surname,@Fathersname,@Gender_Id,@Classification_Id"+" )VALUES ( " + "@TRN,@Firstname,@Surname,@Fathersname,@Gender_Id,@Classification_Id"+")"+ "SET @Id = SCOPE_IDENTITY()"; try{ sqlSelectCommand1.Connection=this.mySqlConnection; sqlSelectCommand1.Parameters.Add("@id",SqlDbType.BigInt); sqlSelectCommand1.Parameters.Add("@TRN",SqlDbType.NVarChar,12); sqlSelectCommand1.Parameters.Add("@Firstname",SqlDbType.NVarChar,150); sqlSelectCommand1.Parameters.Add("@Surname",SqlDbType.NVarChar,150); sqlSelectCommand1.Parameters.Add("@Fathersname",SqlDbType.NVarChar,150); sqlSelectCommand1.Parameters.Add("@Gender_Id",SqlDbType.NChar,1); sqlSelectCommand1.Parameters.Add("@Classification_Id",SqlDbType.Int); sqlSelectCommand1.Parameters["@id"].Value="@Identity"; sqlSelectCommand1.Parameters["@TRN"].Value="identification_number"; sqlSelectCommand1.Parameters["@Firstname"].Value="firstname"; sqlSelectCommand1.Parameters["@Surname"].Value="surname"; sqlSelectCommand1.Parameters["@Fathersname"].Value="fathersname"; sqlSelectCommand1.Parameters["@Gender_Id"].Value="gender"; sqlSelectCommand1.Parameters["@Classification_Id"].Value="1"; sqlSelectCommand1.ExecuteNonQuery(); }is it true?
Reply
Answers (
0
)
Extended Ascii problem
Reading files of all types