public int save_dbf_func(string source_dbf, string str_command) { try { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + source_dbf + ";Extended Properties=dBASE IV;User ID=;Password=;"); // give your path directly OleDbCommand Cmd = new OleDbCommand(); if (con.State == ConnectionState.Closed) con.Open(); Cmd.CommandText = str_command; Cmd.Connection = con; int RowEffect = Cmd.ExecuteNonQuery(); con.Close(); return RowEffect; } catch (Exception ex) { var mm = ex.ToString(); return -1; } }
save_dbf_func("c:\folder", "insert into file.dbf (fName , lName) values ('مرتضی' , 'زند')")
CONVERTLib.ConvertorClass convert_dll = new CONVERTLib.ConvertorClass(); textBox1.Text = convert_dll.WinToIran('مرتضی');
سلام شما dbf خودتون رو به صورت انگلیسی set کردین. save_dbf_func("c:\folder", "insert into file.dbf (fName , lName) values ('N"مرتض"' , '"زند"')"); برای مرتضی هم حرف N رو بذارید
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)