Jeffrey Thornes

Jeffrey Thornes

  • NA
  • 14
  • 868

Connection String and a first action in Ado.Net

Oct 29 2022 9:24 PM

I am working on my creating my first database change with C# and ado.net. This code is my input. I want to save the input to a sql database. Please show me what and where to enter the Connection String and how to use the DataReader to place the input variable in a specific row and column. I think this will help me get going with C# and my project.

Console.WriteLine("What is the location of X?");
string XLoc = Console.ReadLine();
double XLocation = Convert.ToDouble(XLoc);

Console.WriteLine("What is the location of Y?");
string YLoc = Console.ReadLine();   
double YLocation= Convert.ToDouble(YLoc);

Console.WriteLine("What is the location of Z?");
string ZLoc=Console.ReadLine();
double ZLocation= Convert.ToDouble(YLoc);


Answers (1)