Link to home
Start Free TrialLog in
Avatar of Brian Smith
Brian Smith

asked on

ConsoleSql

class Program
    {
        static void Main(string[] args)
        {
            //Enter digits you want to save
            
            
            Console.WriteLine("Give us the first digit");
            string digit1 = Console.ReadLine();
                Console.WriteLine("Give us the second digit");
            string digit2 = Console.ReadLine();

            // using answer Yes/No 
            string pos = "Yes";
            string neg = "No";
            Console.WriteLine("Do you want us to save your digits");
            string answer = Console.ReadLine();
            if (answer.Equals(pos)) ;
            // Sql Server.
            {
                SqlConnection sc = new SqlConnection();
                sc.Open();
                SqlCommand sco = new SqlCommand("Select" + digit1 + "and" + digit2);
                SqlDataAdapter sda = new SqlDataAdapter();
                System.Data.DataSet dataTable = null;
                sda.Fill(dataTable);

Open in new window



why cant I continue with Rows?


why is dataTable.Rows wrong?

how should I continue?
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial