In SqlConnection error: Input string was not in the correct format

Hi.
Im trying to connect my mobile to PC database using this code:

                string cString = @"Persist Security Info=False;Integrated Security=false;Initial Catalog=myDB;server=192.168.1.11,1433\SqlExpress";
                SqlConnection connection = new SqlConnection(cString);
                connection.Open();
                using (SqlCommand cmd = new SqlCommand("SELECT name1 FROM Product", connection))
                {
                    using (SqlDataReader rdr = cmd.ExecuteReader())
                    {
                        while (rdr.Read())
                        {
                            t.Text += rdr.GetString(rdr.GetOrdinal("name1")) + System.Environment.NewLine;
                        }
                    }
                }

            }
            catch (Exception err) { t.Text += err.Message + System.Environment.NewLine + err.Source; }

Unfortunately I'm getting error: "Input string was not in the correcr format", source: mscorlib.

I know that there's error in connectionString (throwin exception after connection.Open())

Any ideas? Thanks in advance!

Sign In or Register to comment.