-
Notifications
You must be signed in to change notification settings - Fork 0
/
servicePrice.aspx.cs
48 lines (46 loc) · 1.69 KB
/
servicePrice.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
48
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ShoppingHotspot
{
public partial class servicePrice : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bindGrid();
}
}
public void bindGrid()
{
string servicetypeName = Request.QueryString["ServiceType"];
lblSeriveTypeByQueryString.Text = servicetypeName;
string connetionString;
connetionString = @"Data Source=DESKTOP-536RKL2;Initial Catalog=DBshoppingHotspot;Integrated Security=True";
string query = "select srcvNme.ServiceName,srcvNme.Price from tblService as ServTyp inner join tblServicePrice as srcvNme on ServTyp.id=srcvNme.ServiceTypeId where ServTyp.title='"+ servicetypeName + "'";
using (SqlConnection con = new SqlConnection(connetionString))
{
using (SqlDataAdapter sda = new SqlDataAdapter(query, con))
{
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GrdServicePrice.DataSource = dt;
GrdServicePrice.DataBind();
}
}
}
}
protected void GrdServicePrice_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GrdServicePrice.PageIndex = e.NewPageIndex;
bindGrid();
}
}
}