如何通过iraninanSystem codePage将信息存储到dbf文件 [英] how to store information to dbf files by iraninanSystem codePage

查看:61
本文介绍了如何通过iraninanSystem codePage将信息存储到dbf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨同性恋



我通过以下代码绑定到Dbf文件并存储我的信息



Hi gays

I am bound to Dbf file by the below code and store my information

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;
    }
}





例如:





for example :

save_dbf_func("c:\folder", "insert into file.dbf (fName , lName) values ('مرتضی' , 'زند')")





并通过dll将我的字符串转换为伊朗系统codePage,例如:





And by a dll convert my string to Iranian system codePage for example:

CONVERTLib.ConvertorClass convert_dll = new CONVERTLib.ConvertorClass();

    textBox1.Text = convert_dll.WinToIran('مرتضی');







将字符串转换为文本框是正确的,但是当我将字符串存储在大多数字符的Dbf文件显示???? ??? ?????。



请指导我如何使数据库中存储的信息没有损坏。



谢谢




converted string into the textbox is correct but when I store the string in the Dbf file for most characters show ???? ??? ?????.

Please guide me how to make the information stored in the database that they are not damaged.

Thanks

推荐答案

سلام شما dbf خودتون رو به صورت انگلیسی set کردین.
save_dbf_func("c:\folder", "insert into file.dbf (fName , lName) values ('N"مرتض"' , '"زند"')");
برای مرتضی هم حرف N رو بذارید


这篇关于如何通过iraninanSystem codePage将信息存储到dbf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆