Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am devlop windows application, plz suggest me,when i am type marathi value in textbox then this marathi value is stored in database........thanks
Posted
Comments
SOHAM_GANDHI 15-Mar-14 7:36am    
check yor Question in --------------VB.net using C#?------------- what is mean
SOHAM_GANDHI 15-Mar-14 7:37am    
which database you are going to use?
SOHAM_GANDHI 15-Mar-14 7:58am    
i think you have to insert marathi text in database using c#,i' sending you the solution. try it.
Question is confusing. VB.NET or C#? What have you tried?

create the ma access database with 2002-03 format *.mdb format
Table name : transliteration
column 1: EmpPgNo type : number
column 2: EmpName type: long text

it takes data and store it to soham.mdb file
--------------------------code----------------------------------------

try
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C://Users//SOHAM GANDHI//Documents//soham.mdb");
con.Open();
string strsql = "INSERT INTO transliteration(EmpPgNo,EmpName) Values('" + textBox1.Text.ToString() + "','" + textBox2.Text + "')";
OleDbCommand cmd = new OleDbCommand(strsql, con);
cmd.ExecuteNonQuery();
con.Close();
}
catch (Exception EX)
{
MessageBox.Show(EX.Message.ToString());
}
 
Share this answer
 
v5
Comments
Saurabh Kokate 30-Jun-15 1:18am    
Thanks Soham,i resolved the problam....thanx
Hi,

if you are using SQL Database then column type should be Nvarchar

and while saving data add prefix N before value in single quote

for e.g.
SQL
Insert into table (columnname) values (N'value')

Happy Coding!
:)
 
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