Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

shashi_code

@shashi_code
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help me with the query strings.
    S shashi_code

    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

    Database database security help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups