Hello
I am not the master of c# ..........i need little in creating class file for database handling
I know how to connect database and different operation handling, but like to create a class file so that it be easy to connect database My problem is that I cant able to handle various exception and display appropriate message.........
Any help.......
thanks in advance

@adatapost
I know how to handle database .......
my problem is that when the connection is not success then my class file should be display appropriate message...........so i would like to know the different exception in open() function .........

No one knows all the exceptions, the best will be to inherit the exception class. But at will also be a waste you can just try/catch/finally the connection and all the exceptions will be caught.

-----so i would like to know the different exception in open() function .........

System.InvalidOperationExecption
System.Data.SqlClient.SqlException
System.ArgumentException

@james6754
I can't able understand what you try to say can you explain little bit more?

@Singlem
thats I know.......

anyway thanks for your kind help..........

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.