Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
26
Reply
problem with checkbox and arabic when insert to sql server
ÃHmed Élkady
Sep 4 2015 1:05 AM
697
Reply
i had a group of check boxes that insert the checked values in 1 row each time by this code
SqlConnection sqlcon = new SqlConnection();
sqlcon.ConnectionString = @"Data Source=(local);Initial Catalog=cleopatra;Integrated Security=True";
List<string> checks = new List<string>();
foreach (Control cont in this.groupBox1.Controls)
{
if (cont is CheckBox)
{
if (((CheckBox)cont).Checked == true)
{
checks.Add(((CheckBox)cont).Text.ToString() + " , ");
}
}
}
sqlcon.Open();
SqlCommand sqlcmd = new SqlCommand("INSERT INTO pateint (mm) VALUES ( '" + string.Join(" ", checks) + "')", sqlcon);
sqlcmd.ExecuteNonQuery();
sqlcon.Close();
MessageBox.Show("ok");
and it insert as ???? marks i make it nchar and collation arabic
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
26
)
Next Recommended Forum
gridview and dropdownlist
how can update exe from server to client Machine?