コード例 #1
0
        public string VrniTrenutniPriimekUporabnika(string username)
        {
            Uporabniki trenutni = new Uporabniki();

            using (SqlConnection myConnection = new SqlConnection(ConnectionString))
            {
                string     sql  = "Select Priimek From MetaUser where Username='******'";
                SqlCommand oCmd = new SqlCommand(sql, myConnection);
                myConnection.Open();
                using (SqlDataReader oReader = oCmd.ExecuteReader())
                {
                    while (oReader.Read())
                    {
                        trenutni.Priimek = oReader[0].ToString();
                    }
                    myConnection.Close();

                    return(trenutni.Priimek);
                }
            }
        }