Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

binumon kb

@binumon kb
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Sort 2 Sheets and update on another Sheet with ole DB
    B binumon kb

    private DataTable SortSheet(string FilePath, string SheetName, string SortColumnName,string RankColumn)
    {
    try
    {
    var fileName = FilePath;
    if (!File.Exists(FilePath))
    {
    txtLogger.Text += FilePath + " File Not Found!!!" + Environment.NewLine;
    MessageBox.Show(" File Not Found!!!");
    new DataTable();
    }

                #region Reading excel file 
                // var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Extended Properties=\\"Excel 12.0;IMEX=1;HDR=NO;TypeGuessRows=0;ImportMixedTypes=Text\\""; ;
                var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Extended Properties=\\"Excel 12.0;IMEX=0;HDR=YES;TypeGuessRows=0;ImportMixedTypes=Text\\""; ;
                DataSet ds = new DataSet();
                using (var conn = new OleDbConnection(connectionString))
                {
                    try
                    {
                        try
                        {
                            conn.Open();
    
                        }
                        catch (Exception ex1)
                        {
                            txtLogger.Text += " exception : " + ex1.StackTrace + Environment.NewLine;
    
                            MessageBox.Show("File is Open, Please close to proceed!!!");
                            new DataTable();
    
                        }
    
                        var sheets = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object\[\] { null, null, null, "TABLE" });
    
                        DataRow\[\] dr = sheets.Select("\[Table\_name\]= '" + SheetName.ToString() + "$'");
                        if (dr.Length == 0)
                        {
                            MessageBox.Show("SheetName Not Found!!!");
                            txtLogger.Text += SheetName.ToString() + "  : SheetName Not Found!!!" + Environment.NewLine;
    
    ASP.NET database com announcement workspace
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups