Click here to Skip to main content
15,887,988 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problems with opening Child Window in MDI Pin
RichardAlbrecht4-Oct-07 9:12
RichardAlbrecht4-Oct-07 9:12 
GeneralRe: Problems with opening Child Window in MDI Pin
Pete O'Hanlon4-Oct-07 10:40
mvePete O'Hanlon4-Oct-07 10:40 
QuestionBeing more generic Pin
Ryno Burger4-Oct-07 8:18
Ryno Burger4-Oct-07 8:18 
AnswerRe: Being more generic Pin
MartyExodus4-Oct-07 8:42
MartyExodus4-Oct-07 8:42 
AnswerRe: Being more generic Pin
PIEBALDconsult4-Oct-07 9:09
mvePIEBALDconsult4-Oct-07 9:09 
AnswerRe: Being more generic Pin
PIEBALDconsult4-Oct-07 9:14
mvePIEBALDconsult4-Oct-07 9:14 
AnswerRe: Being more generic Pin
Pete O'Hanlon4-Oct-07 10:37
mvePete O'Hanlon4-Oct-07 10:37 
AnswerRe: Being more generic [modified] Pin
Nissim Salomon4-Oct-07 11:05
Nissim Salomon4-Oct-07 11:05 
Hi
Try using the following code
that use generics in order to construct the desired type sqlcommand
class Program
    {
        public static T SetupCommand<T>() where T : IDbCommand, new() 
        {
            T cmd = new T();
            cmd.CommandText = "SELECT * FROM Test";            
            cmd.CommandTimeout = 180;            
            return cmd;
        }
        
        static void Main(string[] args)
        {
            
            SqlCommand sqlClientCmd = SetupCommand<SqlCommand>();
            OleDbCommand oleDBCmd = SetupCommand<OleDbCommand>();
        }
    }





-- modified at 6:21 Friday 5th October, 2007
QuestionPost blog using C# Pin
Phoen254-Oct-07 8:02
Phoen254-Oct-07 8:02 
AnswerRe: Post blog using C# Pin
Judah Gabriel Himango4-Oct-07 9:13
sponsorJudah Gabriel Himango4-Oct-07 9:13 
AnswerRe: Post blog using C# Pin
Pete O'Hanlon4-Oct-07 10:44
mvePete O'Hanlon4-Oct-07 10:44 
QuestionSlide-down/up Menubar... Pin
hostopolis4-Oct-07 7:25
hostopolis4-Oct-07 7:25 
Questionreading byte[] instead of binary reader Pin
Xmen Real 4-Oct-07 6:38
professional Xmen Real 4-Oct-07 6:38 
AnswerRe: reading byte[] instead of binary reader Pin
Rob Philpott4-Oct-07 7:05
Rob Philpott4-Oct-07 7:05 
GeneralRe: reading byte[] instead of binary reader Pin
Xmen Real 4-Oct-07 14:23
professional Xmen Real 4-Oct-07 14:23 
AnswerRe: reading byte[] instead of binary reader Pin
Lutosław4-Oct-07 7:23
Lutosław4-Oct-07 7:23 
QuestionHow to bind a vertical scrollbar control to a treeview Pin
Gwidiom4-Oct-07 5:59
Gwidiom4-Oct-07 5:59 
QuestionDeleting words from string Pin
Ryno Burger4-Oct-07 5:42
Ryno Burger4-Oct-07 5:42 
AnswerRe: Deleting words from string Pin
Anthony Mushrow4-Oct-07 5:45
professionalAnthony Mushrow4-Oct-07 5:45 
GeneralRe: Deleting words from string Pin
KaineDunno4-Oct-07 5:50
KaineDunno4-Oct-07 5:50 
GeneralRe: Deleting words from string Pin
Anthony Mushrow4-Oct-07 6:00
professionalAnthony Mushrow4-Oct-07 6:00 
GeneralRe: Deleting words from string Pin
Ryno Burger4-Oct-07 6:00
Ryno Burger4-Oct-07 6:00 
GeneralRe: Deleting words from string Pin
Ryno Burger4-Oct-07 6:11
Ryno Burger4-Oct-07 6:11 
GeneralRe: Deleting words from string Pin
Ryno Burger4-Oct-07 6:19
Ryno Burger4-Oct-07 6:19 
GeneralRe: Deleting words from string Pin
Ryno Burger4-Oct-07 6:31
Ryno Burger4-Oct-07 6:31 

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.