diff --git a/AuthorsApplication/.vs/AuthorsApplication/v16/.suo b/AuthorsApplication/.vs/AuthorsApplication/v16/.suo index f213b36..0df3050 100644 Binary files a/AuthorsApplication/.vs/AuthorsApplication/v16/.suo and b/AuthorsApplication/.vs/AuthorsApplication/v16/.suo differ diff --git a/AuthorsApplication/AuthorsApplication/Form1.cs b/AuthorsApplication/AuthorsApplication/Form1.cs index 5b176c1..1c38875 100644 --- a/AuthorsApplication/AuthorsApplication/Form1.cs +++ b/AuthorsApplication/AuthorsApplication/Form1.cs @@ -32,6 +32,13 @@ private void InitializeForm() conn = new SqlConnection(connString); + //run sql files - create view + string viewScript = File.ReadAllText("testViewNoParam.sql"); + //Below is commented out because it is mostly a copy of how the procedure was created and I am not sure how that works. + //SQLCommand createViewScript = new SQLCommand(viewScript, conn); + + + //run sql files - generate procedure string script = File.ReadAllText("setup.sql"); if (conn.State != ConnectionState.Open) conn.Open(); @@ -44,7 +51,7 @@ private void listBox1_SelectedIndexChanged(object sender, EventArgs e) //TODO - LIST Books per author - need view string currentSelection; - + // We will have to use an ALTER VIEW statement to change the au_id in the WHERE clause currentSelection = (listAuthors.SelectedItem as DataRowView)["au_id"].ToString(); //set global variable - used for sp button diff --git a/AuthorsApplication/AuthorsApplication/bin/Debug/testViewNoParam.sql b/AuthorsApplication/AuthorsApplication/bin/Debug/testViewNoParam.sql new file mode 100644 index 0000000..3ad075a --- /dev/null +++ b/AuthorsApplication/AuthorsApplication/bin/Debug/testViewNoParam.sql @@ -0,0 +1,6 @@ +CREATE VIEW testViewNoParam + SELECT au_fname, au_lname, title + FROM authors + JOIN titleauthor ON authors.au_id = titleauthor.au_id + JOIN titles ON titleauthor.title_id = titles.title_id + WHERE au_id = '172-32-1176' \ No newline at end of file diff --git a/AuthorsApplication/AuthorsApplication/obj/Debug/AuthorsApplication.csprojAssemblyReference.cache b/AuthorsApplication/AuthorsApplication/obj/Debug/AuthorsApplication.csprojAssemblyReference.cache index ac0702c..65ec90f 100644 Binary files a/AuthorsApplication/AuthorsApplication/obj/Debug/AuthorsApplication.csprojAssemblyReference.cache and b/AuthorsApplication/AuthorsApplication/obj/Debug/AuthorsApplication.csprojAssemblyReference.cache differ