Click here to Skip to main content
15,888,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void button1_Click_1(object sender, EventArgs e)
 {
   try
    {
SqlConnection abc = new SqlConnection(Connection);
abc.Open();
SqlCommand cmd = new SqlCommand("insert into policrec values('" + polnam.Text + '",'" + loct.Text + '",'" + cort.Text + "')", abc);
cmd.ExecuteNonQuery();
        MessageBox.Show("Data succefully enter");
             Show();
            }
           catch (Exception ee)
           {
            MessageBox.Show(ee.GetBaseException().ToString());
           }

        }

WE used the above code for insert urdu value in database but it not display correct syntax display like this..????????????????????????
we also used data type in database nvarchar but still have a problem...
plz give me correct any urdu function urdu is just store in unicode...plz help me
Posted
Updated 17-Feb-12 0:39am
v5

You can change the collation for your database with the following :
SQL
ALTER DATABASE [database_name] COLLATE SQL_Latin1_General_CP1_CI_AS;

Select a valid collation for your text format fro the following link:
http://msdn.microsoft.com/en-us/library/ms144250.aspx[^]
 
Share this answer
 
OOH MAN
just put "N" Define Unicode class system.string....like this below code
C#
private void button1_Click_1(object sender, EventArgs e)
 {
   try
    {
SqlConnection abc = new SqlConnection(Connection);
abc.Open();
SqlCommand cmd = new SqlCommand("insert into policrec values(N'" + polnam.Text + "',N'" + loct.Text + "',N'" + cort.Text + "',N'" + datc.Text + "')", abc);
cmd.ExecuteNonQuery();
        MessageBox.Show("Data succefully enter");
             Show();
            }
           catch (Exception ee)
           {
            MessageBox.Show(ee.GetBaseException().ToString());
           }

        }

but remember your databse fields datatype nvarchar

Enjoy ....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900