1
Answer

Class Database Connection

Therese Puno

Therese Puno

16y
1.9k
1

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data;

using System.Data.SqlClient;

namespace ElectronicBankingSystem

{

class SQLdatabaseConn

{

public void MyConnection()

{

SqlConnection SqlCon = new SqlConnection(@"SERVER = SOLOMON; User ID=sa;password=sa;Initial Catalog=BPHTEST;Data Source=solomon");

SqlCon.Open();

}

}

}

 

hi..all Will you please help me about on how to declare database connection in a class?

Thank you very much..

 

Answers (1)