Results 1 to 5 of 5

Thread: [RESOLVED] Specified Cast Is not valid

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    141

    Resolved [RESOLVED] Specified Cast Is not valid

    when we run this code with Debug.WriteLine Generate No error
    when we run this code with dReader.GetValue/GetString Generate Error Specified Cast Is not valid In Database field datatype also Varchar

    public string GetID(string strQuery)
    {
    SqlDataReader dReader=null;
    string RCode="";
    try
    {
    dReader = FillDataReader(strQuery,dReader);
    if (dReader.Read())
    {
    //Debug.WriteLine(dReader.GetValue(0));
    RCode = (string)dReader.GetValue(0);
    return RCode;
    }
    }


    }
    Last edited by Waseemalisyed; May 10th, 2005 at 06:31 AM. Reason: ok

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width