Datareader give “Unspecified Error ” after 64 database transaction(open /close Connection) With

Hello All

I am using MS-Access database and I use Data reader as closeconnection behvrior such like give belowe.

Con.Open();

Rdr = Cmd.ExecuteReader(CommandBehavior.CloseConnection);

When I have complete 64 transaction(connection Open/Close) with database It give error

Such like “Unspecified Error”

Please give any idea.

Thanks

Anup patel

[1870 byte] By [anupphansa] at [2008-1-10]
# 1

Hi Anup

Did you try with Con.Close()?

Code Snippet

Con.Open();

Rdr = Cmd.ExecuteReader();

Con.Close();

Thanks

PrafulkumarPatel at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

Hello

Prafulkumar

Thank for Your Reply,

I have made MyExecuteReader() Method that is use in multiple place in code

So I have made given below Method

#region ExecuteReader

public OleDbDataReader MyExecuteReader(string Quary)

{

OleDbConnection Con = new OleDbConnection();

OleDbCommand Cmd = new OleDbCommand();

OleDbDataReader Rdr;

try

{

Con.ConnectionString = ConString;

Cmd.Connection = Con;

Cmd.CommandText = Quary;

if (Con.State == ConnectionState.Open)

{

Con.Close();

}

Con.Open();

Rdr = Cmd.ExecuteReader(CommandBehavior.CloseConnection);

}

catch (Exception ex)

{

MessageBox.Show(ex.ToString());

MessageBox.Show(ex.Message.ToString());

Rdr = null;

LogInfo(ex.Message.ToString(), Quary);

}

finally

{

Cmd.Dispose();

}

return Rdr;

}

#endregion

I does not want to use give below , it is not usefull for all Quary ,So pleasegive Idea of My Problem

“ Datareader give “Unspecified Error ” after 64 database transaction(open /close Connection) With MS-Access database”

Con.Open();

Rdr = Cmd.ExecuteReader();

Con.Close();

anupphansa at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3

Hey Anup,

Can you send me the Error Text So I can Find out what is the root cause.

Thanks

PrafulkumarPatel at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 4

Hi

Mr. Patel

Error Message is “Unspecified Error” When I Use ex.Message()

And How to attach Image in this forum ?

Thanks

Anup Patel

anupphansa at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified