title: SQL Server 2008 changed table name bizarre behavior
body: <p>I changed the name of one of my tables, then afterwards encoded some data then pulled it using a view to my surprise the data is not showing. I tried renaming it back to its original name with no luck the same thing is happening.</p>
  
  <p>Then finally I tried retyping the data on one of the columns and then executed the view and there the data is finally showing now the problem arises I need to re encode the data on one of the column every time a data is inserted which is obviously not a good thing to do.</p>
  
  <p>here is the code on how i added some data</p>
  
  <pre><code>tblcsv.Columns.AddRange(new DataColumn[7] { new DataColumn("unit_name", typeof(string)), new DataColumn("unit", typeof(string)), new DataColumn("adrress", typeof(string)), new DataColumn("latitude", typeof(string))
                  ,new DataColumn("longitude" , typeof(string)) , new DataColumn("region" , typeof(string)) , new DataColumn("linkid" , typeof(string))});
                  string ReadCSV = File.ReadAllText(forex);
                  foreach (string csvRow in ReadCSV.Split('\n'))
                  {
                      if (!string.IsNullOrEmpty(csvRow))
                      {
                          //Adding each row into datatable  
                          tblcsv.Rows.Add();
                          int count = 0;
                          foreach (string FileRec in csvRow.Split(','))
                          {
                              tblcsv.Rows[tblcsv.Rows.Count - 1][count] = FileRec;
                              if (count == 5)
                              {
                                  tblcsv.Rows[tblcsv.Rows.Count - 1][6] = link;
                              }
                              count++;
                          }
                      }
  
  
                  }
  
  
                      string consString = ConfigurationManager.ConnectionStrings["diposlConnectionString"].ConnectionString;
                      using (SqlConnection con = new SqlConnection(consString))
                      {
                          using (SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(con))
                          {
                              //Set the database table name
                              sqlBulkCopy.DestinationTableName = "dbo.FRIENDLY_FORCES";
  
                              //[OPTIONAL]: Map the Excel columns with that of the database table
                              sqlBulkCopy.ColumnMappings.Add("unit_name", "unit_name");
                              sqlBulkCopy.ColumnMappings.Add("unit", "unit");
                              sqlBulkCopy.ColumnMappings.Add("adrress", "adrress");
                              sqlBulkCopy.ColumnMappings.Add("latitude", "latitude");
                              sqlBulkCopy.ColumnMappings.Add("longitude", "longitude");
                              sqlBulkCopy.ColumnMappings.Add("region", "region");
                              sqlBulkCopy.ColumnMappings.Add("linkid", "linkid");
                              con.Open();
                              sqlBulkCopy.WriteToServer(tblcsv);
                              con.Close();
                          }
                      }
  </code></pre>
  
  <p>the column region is where i manually edited the data</p>
  
  <p>Did the renaming of the table did something to my data?</p>
  
  <p>Or am I just missing something?</p>
  
  <p>Thank you</p>