Hi,
Im currently making a very simple WebApp on a Website using ASP.NET Framework using C# in Visual Studio 2010.
The website will connect to my SQL EXPRESS server running on my laptop (Its all locally based)
I have a table defined as below
CREATE TABLE Users(
userName varchar(50),
email varchar(50),
firstName varchar(50),
lastName varchar(50),
gender varchar(50),
birthday date,
age int,
location varchar(50),
gname varchar(50)
PRIMARY KEY (userName, email))
GO
Now, I have a page on my website called Users. NOTE: gname means Group Name (ie, users join an interest group.)
Here I have a form that looks something like this:
UserName:
Gender:
Age:
GroupName:
Location:
Now, this would mean I have 5 different fields, and hence, I would have to write 25 SQL statements for each different case. Which I find pretty naive.
I tried Googling around for Dynamic SQL Statements, which do not seem to be addressing my problem here (or at least I don't understand how they address my problem).
Can anyone point me in the right direction to learn how to implement SQL statements thats smart enough to generate queries based on which field has been given input by the user?
Apologise to anyone who might think I have not done my research to something that might seem rather simple.
-Ali