Ron Danish

Ron Danish

  • NA
  • 4
  • 0

need help, will pay consultant

Jun 3 2009 5:57 PM

I am a rookie contract programmer, starting in c# - I have a problem and will pay a consultant who can help me correct an issue from c# 2.0 windows forms application thru oledb to a foxpro .DBF file.  I can connect and bring down data, and it must bind thru the oledb (or other) dataadapter such that the journaling information (aka dataView.CurrentModified) is maintained.   My problem is that it will not TRIM or ALLTRIM or LTRIM or RTRIM on SELECT statement on the call to a .DBF  Always returns data padded w spaces the size of the field and because it binds straight to a datagridview after creation, I cannot remove them.  IS there a workaround ?  I believe that the oleDBDataAdapter is a must to enable the journaling feature.  Help!
            string m_SQLCommandString = "select   NATIVE ,ALLTRIM(LOCAL), ALLTRIM(LOCAL)  from " + language;
            m_oleDBConnectionString = @"Provider=vfpoledb;Data Source='" + pathToUse + "';FileName='" + language + ".DBF';password='';user id=''";
            OleDbConnection oleDBConnection = new OleDbConnection(m_oleDBConnectionString);
   ///Open the connection and create a new DataAdapter

            OleDbCommand command = new OleDbCommand(m_SQLCommandString, oleDBConnection);
            //command.Parameters.Add("@p1", OleDbType.Char, 100).Value = "A%";
           
            oleDBConnection.Open();
            OleDbDataAdapter oleDBDataAdapter = new OleDbDataAdapter(m_SQLCommandString, oleDBConnection);
   
   //Create a blank DataTable and fill the DataTable with the data
   DataTable oleDataTable = new DataTable();
            oleDBDataAdapter.Fill(oleDataTable);
            ////Return the DataView
            return oleDataTable;  

Answers (1)