Problem in Script Generation(bit Urgent)

  • 12 years ago

    hi all,

    I am trying to generate a script for creating a database at run time. I get the following error on cmd.ExecuteNonQuery():

    Insert Error: Column name or number of supplied values does not match table definition.

    I know this got something to do with Store Procedure parameter not matching the no. of fields in the corresponding Table. As I got more than 50 Tables and same no. of Procedures, it is hard to match ever table with the procedure.

    So I just want to know that is there any way that I can find the procedure name which is giving me the error?



  • 12 years ago


    When you say generate a script, do you mean like a PL/SQl or T/SQL procedure to create the tables?

    If so, you should look at trapping the errors in there and throwing your own exception telling you the details of which procedure failed.

    If you mean you have 50 stored procedure calls in different functions and one is failing, you should trap the exceptions being hurled at you and transform them into something more meaningful by letting you know which one has failed etc.



Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray