2
我對下面的代碼綁定到dbf文件,並保存我的信息如何iraninanSystem代碼頁來存儲信息,以DBF文件
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 ('مرتضی' , 'زند')")
並通過一個dll轉換我字符串以伊朗系統代碼頁爲例:
CONVERTLib.ConvertorClass convert_dll = new CONVERTLib.ConvertorClass();
textBox1.Text = convert_dll.WinToIran('مرتضی');
將字符串轉換成文本框是正確的,但是wh en我將字符串存儲在Dbf文件中以獲得大多數字符顯示???? ??? ?????。
請指導我如何使存儲在數據庫中的信息不被損壞。
感謝
salam,mitoni鏈接在dll下載WinToIran ro be man bedi? inam email man:[email protected] – javadaskari
你有沒有找到解決方案? – atabrizi