Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 28th, 2005, 01:42 AM
spc spc is offline
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error in running the .exe file of my application

Hi All,

  I have developed a migration tool for migrating data from MySQL to MSSQL using C#.Net . The application works fine while running it from the Visual Studio .net IDE, but problem occured when I tried to run it from the .exe file of my application. It shows the following
error -
Error: Object reference not set to an instance of an object.
at System.Data.Common.Odbc32.SQLFetch(HandleRef StatementHandle)
at System.Data.Odbc.OdbcDataReader.RetrieveKeyInfo(Bo olean needkeyinfo, QualifiedTableName qualifiedTableName)
   at System.Data.Odbc.OdbcDataReader.BuildMetaDataInfo( )
   at System.Data.Odbc.OdbcDataReader.GetSchemaTable()
   at System.Data.Common.DbDataAdapter.FillSchemaFromCom mand(Object data, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillSchema(DataSe t dataSet, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillSchema(DataSe t dataSet, SchemaType schemaType, String srcTable)
   at DBPorting.Table.getTableData(OdbcConnection Conn, String Qry, String tabname) ( This function is written by me & here is the code for your easy reference )-

public DataSet getTableData(OdbcConnection Conn, String Qry,String tabname)
    {
/* The Qry is a selec query to select data from the table. Conn is OdbcConnection to connect to the source database.oCommand & adapter are private members of the class.*/
       DataSet tabData =new DataSet();
       oCommand.Connection=Conn;
       oCommand.CommandText=Qry;

       tabData.Reset();

       adapter.SelectCommand=oCommand;
       adapter.FillSchema(tabData,SchemaType.Source,tabna me);

       adapter.Fill(tabData,tabname);

       return tabData;
    }





Similar Threads
Thread Thread Starter Forum Replies Last Post
Running exe file without visual studio Graphics General .NET 1 October 27th, 2007 10:09 AM
Running an .exe from an ASP.Net application Laggin ASP.NET 1.0 and 1.1 Professional 22 June 3rd, 2007 12:46 AM
Running my VB 2005 exe file dilionyi Visual Basic 2005 Basics 4 August 10th, 2006 10:00 AM
running .exe file in asp.net hotshot_21 ASP.NET 1.0 and 1.1 Basics 0 January 9th, 2006 08:32 AM
running .exe file in web application exactlynn General .NET 0 May 5th, 2004 11:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.