Getchar in sahil’s post

Posted: February 1, 2005 in Uncategorized

While going through the  blog of sahil i had gone through his post on getchars look the link

Here is my commnets on the same:-

hi sahil,

i think you might have per your logic the same would not be compiled with error but you have given the wrong inputs.Below is the code kindly look i have given test data only.


using (SqlConnection conn = new SqlConnection("constr here"))
    SqlCommand cmd = conn.CreateCommand();
    cmd.CommandText = "Select * from emp";
    SqlDataReader dr = cmd.ExecuteReader();
    long i;
    char[] chr=new char[4];
    //char c = dr.GetChar(1);

may be i am wrong.kindly put ur comments on same.

I was indeed wrong considering getchar as getchars();see the commnets….


  1. Shreeman says:

    HiSahil is correct in saying that the getchar() is giving the exception.I tried to use the getchars it was a misunderstanding between getchar and getchars hoom…the all about it.however the getchar is not supported in intellisense is the comment from sahil:-Shreeman .. The point was .. GetChar compiles, and the MSDN says it will return you one character. But it is in truth not implemented. Yes I could do GetChars .. but .. this blog post is about GetChar !! So no .. no misguiding here :-) _ SM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s