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
G

Glen Childs

@Glen Childs
About
Posts
12
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Cars and computers
    G Glen Childs

    Gearboxes definitely don't last :)

    Code quality is measured by the WTF/s a minute.

    The Lounge linq data-structures functional help career

  • SQL Primary Key Issue
    G Glen Childs

    Hello,

    I have imported a CSV file into SQL, the wizard has added this as a new table.

    I am trying to run a SQL Statement to insert the data from the imported table into the one I need to use in the new data table.

    However I am getting the following error.

    Collapse | Copy Code
    Msg 2627, Level 14, State 1, Line 4
    Violation of PRIMARY KEY constraint 'PK_Customer'. Cannot insert duplicate key in object 'dbo.Customer'. The duplicate key value is (105).
    The statement has been terminated.

    This is my statement:

    Collapse | Copy Code
    INSERT INTO dbo.Customer
    (custID,lastName,firstName,title,address1,address2,address3,postCode,email,fax)
    SELECT ACCOUNT,SURNAME,FORENAMES,TITLE,ADD1,ADD2,ADD3,POSTCODE,EMAIL,FAX
    FROM dbo.[NCCUST CSV FORMAT PFS 9.1.14];

    Any pointers would be great Smile | :)

    Thanks

    C# help database sales

  • Create power point(ppt) from c# and add image to it
    G Glen Childs

    This maybe of some use :) http://www.free-power-point-templates.com/articles/create-powerpoint-ppt-programmatically-using-c/[^]

    C# csharp

  • I am getting an error when trying to save an XLS to .DBF file.
    G Glen Childs

    Okay Thanks will try that! :-D

    C# database com security performance help

  • I am getting an error when trying to save an XLS to .DBF file.
    G Glen Childs

    I am trying to achieve an application that is able to read in an Excel Spreadsheet (.XLS) and be able to convert/save out to a Database file (.DBF). Regards,

    C# database com security performance help

  • I am getting an error when trying to save an XLS to .DBF file.
    G Glen Childs

    Okay thanks, same error occurs though with Data Source as two words.

    C# database com security performance help

  • I am getting an error when trying to save an XLS to .DBF file.
    G Glen Childs

    Thanks solved that error, I am getting a different error now tho :confused: error: 'DataSource=excelFilePath;InitialCatalog=master;IntegratedSecurity' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.

    C# database com security performance help

  • I am getting an error when trying to save an XLS to .DBF file.
    G Glen Childs

    Hello, I am getting an error when trying to save my XLS to .DBF. The error is: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'. I am getting the error at this line of code: var cnn = new OleDbConnection(cnnStr);

    //Connection string for SQL
    var cnnStr = @"Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=C:\file.xls;ReadOnly=1;ColNameHeader=False";

            //Creates a new OleDbConnection with an argument of cnnStr
            var cnn = new OleDbConnection(cnnStr);
    
            //creates new datatable in memory to store the read excel spreadsheet.
            var dt = new DataTable();
    
            try
            {
                //Opens the new connection called "cnn". 
                cnn.Open();
    
                string sqlConnectionString = "Data Source=Zach-PC;Initial Catalog=master;Integrated Security=True";
    
    
                var schemaTable = cnn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                if (schemaTable.Rows.Count < worksheetNumber) throw new ArgumentException("The worksheet number provided cannot be found in the spreadsheet");
                //string worksheet = schemaTable.Rows\[worksheetNumber - 1\]\["table\_name"\].ToString().Replace("'", "");
                string sql = String.Format("select \* from \[{0}\]", sqlConnectionString);
                var da = new OleDbDataAdapter(sql, cnn);
                da.Fill(dt);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // close resources
                cnn.Close();
            }
    

    Any pointers? ;P

    Regards, Glen

    C# database com security performance help

  • What is the difference between "Show() "and "ShowDialog()"?
    G Glen Childs

    I think you wont be able to do: fmTest.Show(); as "fmTest" is the main/only form. Can someone correct me if im wrong.

    C# question

  • What is the difference between "Show() "and "ShowDialog()"?
    G Glen Childs

    .Show will show the form you want to display and will allow you to go back to the other window without closing it, and .ShowDialog will show the form you want to display and wont allow you to go back to the other window with out closing the new window.

    C# question

  • Apple beats Coca-Cola to emerge as most valuable global brand
    G Glen Childs

    Apples brand is powerful purely because it is designed to be easy to use - like plug and play it does it for you, good for people on the move. Im not a massive fan of the iOs now though.

    The Lounge com help learning

  • Beginning C# journey - knowledge and tips...
    G Glen Childs

    Hello, when I started to learn C# I found that dotnetperls.com really helped to explain the basics of c#

    C# csharp database sqlite help
  • Login

  • Don't have an account? Register

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