All pastes #219753 Raw Edit

Shin-Ra

public text v1 · immutable
#219753 ·published 2006-10-24 21:03 UTC
rendered paste body
public string DBVersion()
        {
            SqlDataControls sdc = new SqlDataControls();
            using(SqlCommand comm = CreateCommand())
            {
                comm.CommandText = "SELECT SERVERPROPERTY('productversion')";
                string version = "";
                using(DataSet ds = new DataSet())
                {
                    using(SqlDataAdapter da = new SqlDataAdapter())
                    {
                        da.SelectCommand = comm;
                        da.Fill(ds);
                        version = ds.Tables[0].ToString();
                    }
                }
                return version;
            }
        }