C# out of scope dealing with mutliple sql statements
===

I have this code snippet:

The variable m is a string set as the Name returned by the first sql command, that is closed and then the second is used to return other details. At this point m is used to populate the view, but visual studio says it is an unassigned variable. How do I fix this?


    SqlCommand mcom = new SqlCommand("SELECT * FROM [Rica].[dbo].[MaritialStatus] WHERE ID=" + myReader["MaritalStatusID"], mnner);


                                SqlDataReader mread = null;
                                mread = mcom.ExecuteReader();

                                while (mread.Read())
                                {
                                    m = mread["Name"].ToString();
                                }
                                mnner.Close();


                                user_table.Text = user_table.Text + "<tr><td>"+ myReader["PostCode"] +"</td>";

                                //user details
                                SqlConnection inner = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["RicaConnectionString"].ConnectionString);
                                inner.Open();

                                SqlCommand icom = new SqlCommand("SELECT * FROM [Rica].[dbo].[User] WHERE ID=" + myReader["ID"], inner);


                                SqlDataReader iread = null;
                                iread = icom.ExecuteReader();

                                while (iread.Read())
                                {


                                    user_table.Text = user_table.Text + "<td>" + iread["NamePrefix"] + " " + iread["FirstName"] + " " + iread["LastName"] + "</td><td>" + iread["Username"] + "</td><td>" + g + "</td><td>" + m + "</td></tr>";
                                }

                                iread.Close();