Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
778 B
3
Indexable
Never
public static SqlDataReader Sqlreader;
        public static readonly SqlDataAdapter Sqladapter = new();
        public static readonly SqlCommand Sqlcmd = new();
        public static SqlConnection Cnn = new();
        public static string Strsql;

        public static async Task<bool> Conopen()
        {
            try
            {
                string? Cstring;
                Cstring =
                    $"Data Source =25.2.10.239;Initial Catalog=Student_IS_db;Integrated Security=False;User ID=sa;Password=administrator01;";
                Cnn = new SqlConnection(Cstring);
                await Cnn.OpenAsync();
                return true;
            }
            catch
            {
                return false;
            }
        }