Click here to Skip to main content
15,912,205 members
Home / Discussions / Database
   

Database

 
AnswerRe: LastModifiedDate Pin
Wendelius4-Sep-08 9:45
mentorWendelius4-Sep-08 9:45 
GeneralRe: LastModifiedDate Pin
geekfromindia4-Sep-08 9:47
geekfromindia4-Sep-08 9:47 
GeneralRe: LastModifiedDate Pin
Wendelius4-Sep-08 10:12
mentorWendelius4-Sep-08 10:12 
GeneralRe: LastModifiedDate Pin
geekfromindia4-Sep-08 11:36
geekfromindia4-Sep-08 11:36 
GeneralRe: LastModifiedDate Pin
Wendelius4-Sep-08 11:41
mentorWendelius4-Sep-08 11:41 
AnswerRe: LastModifiedDate Pin
nelsonpaixao4-Sep-08 14:16
nelsonpaixao4-Sep-08 14:16 
GeneralRe: LastModifiedDate Pin
geekfromindia5-Sep-08 4:15
geekfromindia5-Sep-08 4:15 
QuestionHelp me with the query strings. Pin
shashi_code4-Sep-08 4:29
shashi_code4-Sep-08 4:29 
Hi I am developing a project which involves query strings.
I want when user selects a city from a drop down list it has to be passed to the next page and show the values from the database in the gridview based on the value selected in drop downlist.

My code is :

protected void ddlCity_SelectedIndexChanged(object sender, EventArgs e)
{
string url = "Cityschedules.aspx?City="+ ddlCity.SelectedItem.Text;
Response.Redirect(url);

}

When the user Enters say "New Delhi"

It shud show the all the values where city is "New Delhi"

In Cityschedules.aspx

protected void Page_Load(object sender, EventArgs e)
{
try
{

string strSQLconnection = "Data Source=SHASHI-56B0C28E\\SQLEXPRESS;Initial Catalog=Project_Airways;Persist Security Info=True;User ID=sa;Password=sql2005";
SqlConnection sqlConnection = new SqlConnection(strSQLconnection);
SqlCommand sqlCommand = new SqlCommand("SELECT * FROM [ARS_Schedules] WHERE ([Origin_Place] = '@Origin_Place1')", sqlConnection);
sqlConnection.Open();
string Origin_Place1 = Request.QueryString["City"];
SqlDataReader reader = sqlCommand.ExecuteReader();
GridView1.DataSource = reader;
GridView1.DataBind();
}
catch (SqlException se)
{
Console.WriteLine(se.Message);
}
finally
{
sqlConnection.close();
}
}

I am getting exceprion
"{"The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource. A control with ID 'SqlDataSource1' could not be found."}"

Also when this exception is solved i am getting another exception saying
"Must declare scalar variable @origin_Place1"

Thanks in advance


regards
shashi
AnswerRe: Help me with the query strings. [modified] Pin
Blue_Boy4-Sep-08 5:21
Blue_Boy4-Sep-08 5:21 
GeneralRe: Help me with the query strings. Pin
Meenal Ronghe12-Sep-10 23:34
Meenal Ronghe12-Sep-10 23:34 
GeneralRe: Help me with the query strings. Pin
nelsonpaixao4-Sep-08 13:57
nelsonpaixao4-Sep-08 13:57 
AnswerRe: Help me with the query strings. Pin
ahsan sarfraz8-Sep-08 4:45
ahsan sarfraz8-Sep-08 4:45 
QuestionInserting data from an XML string in a table Pin
ONeil Tomlinson4-Sep-08 1:37
ONeil Tomlinson4-Sep-08 1:37 
AnswerRe: Inserting data from an XML string in a table Pin
Wendelius4-Sep-08 8:29
mentorWendelius4-Sep-08 8:29 
QuestionBcp error Pin
si_694-Sep-08 0:29
si_694-Sep-08 0:29 
AnswerRe: Bcp error Pin
Wendelius4-Sep-08 8:26
mentorWendelius4-Sep-08 8:26 
QuestionReg: Handling Text Column in Trigger implementation Pin
Member 40084923-Sep-08 23:38
Member 40084923-Sep-08 23:38 
AnswerRe: Reg: Handling Text Column in Trigger implementation Pin
Wendelius4-Sep-08 8:17
mentorWendelius4-Sep-08 8:17 
QuestionUnion query.. I guess:) Pin
Muammar©3-Sep-08 9:19
Muammar©3-Sep-08 9:19 
AnswerRe: Union query.. I guess:) Pin
TheFM2343-Sep-08 9:32
TheFM2343-Sep-08 9:32 
GeneralRe: Union query.. I guess:) Pin
Muammar©3-Sep-08 9:51
Muammar©3-Sep-08 9:51 
GeneralRe: Union query.. I guess:) Pin
Muammar©3-Sep-08 10:33
Muammar©3-Sep-08 10:33 
AnswerRe: Union query.. I guess:) Pin
Wendelius3-Sep-08 9:35
mentorWendelius3-Sep-08 9:35 
GeneralRe: Union query.. I guess:) Pin
Muammar©3-Sep-08 9:56
Muammar©3-Sep-08 9:56 
GeneralRe: Union query.. I guess:) Pin
Wendelius3-Sep-08 10:01
mentorWendelius3-Sep-08 10:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.