Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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;
    }

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.