Click here to Skip to main content
15,900,973 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionError number description Pin
sacheesach27-Aug-07 0:53
sacheesach27-Aug-07 0:53 
AnswerRe: Error number description Pin
Dave Kreskowiak27-Aug-07 3:21
mveDave Kreskowiak27-Aug-07 3:21 
Questiondelegate Pin
Ahamed Azeem27-Aug-07 0:30
Ahamed Azeem27-Aug-07 0:30 
GeneralRe: delegate Pin
Christian Graus27-Aug-07 1:04
protectorChristian Graus27-Aug-07 1:04 
GeneralRe: delegate Pin
Ahamed Azeem27-Aug-07 1:37
Ahamed Azeem27-Aug-07 1:37 
GeneralRe: delegate Pin
Christian Graus27-Aug-07 1:55
protectorChristian Graus27-Aug-07 1:55 
QuestionIs this correct? Pin
dimuthuvbnet27-Aug-07 0:28
dimuthuvbnet27-Aug-07 0:28 
AnswerRe: Is this correct? Pin
Dave Kreskowiak27-Aug-07 3:20
mveDave Kreskowiak27-Aug-07 3:20 
To do what??

As far as your code goes, it's a lousy design. That's about all I can say about this....


dimuthuvbnet wrote:
And data connection is opened another module.


Why?? Why not just have a method in your DAL that creates a DataReader for your command and returns it?? Why are you creating a DataReader in one place, creating a command for it in another, using a "global" variable for a connection, chosing bad names for your methods, using two different classes/modules to build this reader, ..., need I continue??

You're really missing the point of encapsulation. This code can be done in a single class, using at a minimum, 2 methods, and a max of 4. One method to retrieve the connection string from a config file, a second to create a connection object (it's also acceptable to combine these first two into one method), and a third to create the data reader. You may either return the data reader, or create another method to use the datareader to create your array, though there are other methods of doing what your code looks like it's doing.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionStart and Stop Times Pin
Brendan Vogt26-Aug-07 23:42
Brendan Vogt26-Aug-07 23:42 
AnswerRe: Start and Stop Times Pin
Christian Graus27-Aug-07 1:07
protectorChristian Graus27-Aug-07 1:07 
QuestionAccessing a Textbox of a Word Document Pin
vimal_yet26-Aug-07 23:33
vimal_yet26-Aug-07 23:33 
Question.GIF FILE Animation Pin
ejaz_pk26-Aug-07 23:14
ejaz_pk26-Aug-07 23:14 
AnswerRe: .GIF FILE Animation Pin
Christian Graus27-Aug-07 1:21
protectorChristian Graus27-Aug-07 1:21 
AnswerRe: .GIF FILE Animation Pin
jathoo27-Aug-07 20:37
jathoo27-Aug-07 20:37 
QuestionRe: .GIF FILE Animation Pin
ejaz_pk27-Aug-07 20:41
ejaz_pk27-Aug-07 20:41 
AnswerRe: .GIF FILE Animation Pin
jathoo27-Aug-07 20:46
jathoo27-Aug-07 20:46 
GeneralRe: .GIF FILE Animation Pin
ejaz_pk27-Aug-07 23:07
ejaz_pk27-Aug-07 23:07 
GeneralRe: .GIF FILE Animation Pin
jathoo28-Aug-07 3:46
jathoo28-Aug-07 3:46 
AnswerRe: .GIF FILE Animation Pin
kostasdiktia227-Aug-07 23:34
kostasdiktia227-Aug-07 23:34 
Questionchange the color of check list box items Pin
Rupesh Kumar Swami26-Aug-07 22:39
Rupesh Kumar Swami26-Aug-07 22:39 
AnswerRe: change the color of check list box items Pin
Dave Kreskowiak27-Aug-07 3:40
mveDave Kreskowiak27-Aug-07 3:40 
GeneralRe: change the color of check list box items Pin
Rupesh Kumar Swami27-Aug-07 3:53
Rupesh Kumar Swami27-Aug-07 3:53 
GeneralRe: change the color of check list box items Pin
Dave Kreskowiak27-Aug-07 4:06
mveDave Kreskowiak27-Aug-07 4:06 
GeneralRe: change the color of check list box items Pin
Rupesh Kumar Swami27-Aug-07 5:28
Rupesh Kumar Swami27-Aug-07 5:28 
QuestionWindows Forms Apperance Pin
PJ_1234526-Aug-07 20:49
PJ_1234526-Aug-07 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.