Recommended Answers
Jump to PostDepends on what database you are using. For SQL Server this page is the command you want, and it even has an example.
Jump to PostIf you are using Sql class do as:
SqlConnection conn = new SqlConnection("connString"); String query = "SELECT SUM(pf5_showplaylists.runningtime) FROM pf5_showplaylists WHERE pf5_showplaylists.showID = @param1"; SqlCommand cmd = new SqlCommand(query, conn); cmd.Parameters.Add("@param1", SqlDbType.Int).Value ShowID; //MUST BE AN INTEGER!! If not do: //cmd.Parameters.Add("@param1", SqlDbType.VarChar, 50).Value ShowID; int mySum = …
Jump to PostTo add: but its almost the same for other providers. If you use OleDb you have to change the query, and not passing parameters into it, instead of you use questionmark "... WHERE pf5_showplaylists.showID = ?"; and define parameter in parametreized query, as I showed up in my previous post.
…
Jump to PostYOu salved the problem?
All 13 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.