Sunday, November 18, 2012 9:33 AM
here is my code.i have to bulkcopy access .mdb into sqldatabase. my data is persian.when i test this code in my computer it works fine. but when i do this in server(on the web) it works good but al my data format damaged like as "" ...
i can't find what this happaned.
please help me.
string s = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("~/.../" + fileName);
OleDbConnection OleDbConn = new OleDbConnection(s);
string sSQLTable = table;
string myAccessDataQuery = "Select * from " + sSQLTable;
OleDbCommand OleDbCmd = new OleDbCommand(myAccessDataQuery, OleDbConn);
OleDbDataReader dr = OleDbCmd.ExecuteReader();
SqlBulkCopy bulkCopy =
new SqlBulkCopy(WebConfigurationManager.ConnectionStrings["mySqlConnectionStr"].ToString() ,
bulkCopy.DestinationTableName = sSQLTable;
Sunday, November 18, 2012 10:05 AMAnswererWhat is about data types in SQL Server, has the field defined as NVARCHAR(n)? Make sure that Persian font is installed on the server too
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Blog: Large scale of database and data cleansing
MS SQL Consultants: Improves MS SQL Database Performance
- Marked As Answer by Allen Li - MSFTModerator Monday, November 26, 2012 2:24 AM
Sunday, November 18, 2012 1:08 PM
Maybe a thread related to
I think that this thread should be moved in the
where this kind of problems is usually treated
Have a nice day
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.