-
Notifications
You must be signed in to change notification settings - Fork 0
/
Search.aspx.cs
47 lines (38 loc) · 1.28 KB
/
Search.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Search : System.Web.UI.Page
{
MySql.Data.MySqlClient.MySqlConnection conn;
MySql.Data.MySqlClient.MySqlCommand cmd;
MySql.Data.MySqlClient.MySqlDataReader reader;
string queryStr;
string artists;
String q;
protected void Page_Load(object sender, EventArgs e)
{
q= Request.QueryString["q"].ToString();
System.Diagnostics.Debug.WriteLine("SomeText1 "+q);
display(q);
}
protected void display(string s) {
String connString = System.Configuration.ConfigurationManager.ConnectionStrings["WebbAppConnString"].ToString();
conn = new MySql.Data.MySqlClient.MySqlConnection(connString);
conn.Open();
queryStr = "";
queryStr = "SELECT artists from movies where title= '" + s + "'";
cmd = new MySql.Data.MySqlClient.MySqlCommand(queryStr, conn);
reader = cmd.ExecuteReader();
while (reader.Read())
{
artists = reader.GetString(reader.GetOrdinal("artists"));
}
conn.Close();
Response.Write(artists);
}
}