You are on page 1of 5

using System;

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using walid_houali_control_tdi_202.ServiceReference1;

namespace walid_houali_control_tdi_202
{

public partial class liste_dependantes : System.Web.UI.Page


{
public void RemplirGrid()
{
Service1SoapClient sp = new Service1SoapClient();
GridView1.DataSource = sp.;
GridView1.DataBind();
protected void Page_Load(object sender, EventArgs e)
{

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs


e)
{

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)


{

protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)


{

protected void GridView1_SelectedIndexChanged2(object sender, EventArgs e)


{

}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Data;

namespace walid_houali_control_tdi_202
{
/// <summary>
/// Description résumée de WebService1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// Pour autoriser l'appel de ce service Web depuis un script à l'aide d'ASP.NET
AJAX, supprimez les marques de commentaire de la ligne suivante.
// [System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{

[WebMethod]
public DataTable get_bds(string nom_instance)
{
ADO d = new ADO();
d.CONNECTER();

d.dap = new SqlDataAdapter("select sqlexpress from sql.database",


d.con);
d.dap.Fill(d.ds, "sqlexoress");

d.DECONNECTER();
return d.ds.Tables["sqlexpress"];
}
public DataTable get_tables (string nom_assistance , string nom_bd)
{
ADO d = new ADO();
d.CONNECTER();

d.dap = new SqlDataAdapter("select sqlexpress from sql.tables", d.con);


d.dap.Fill(d.ds, "fadilizakaria");

d.DECONNECTER();
return d.ds.Tables["fadilizakaria"];
}

public DataTable get_detailes_tables(string nom_instance,string nom_bd,


string nom_table)
{
ADO d = new ADO();
d.CONNECTER();

d.dap = new SqlDataAdapter("select emp from sql.tables", d.con);


d.dap.Fill(d.ds, "emp");

d.DECONNECTER();
return d.ds.Tables["emp"];

}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

namespace walid_houali_control_tdi_202
{
public class ADO
{
// Declaration des objets sql

public SqlConnection con = new SqlConnection();


public SqlCommand cmd = new SqlCommand();
public SqlDataReader dr;
public DataTable dt = new DataTable();
public SqlDataAdapter dap = new SqlDataAdapter();
public DataSet ds = new DataSet();
public SqlCommandBuilder bc;

// declaration de la methode connecter


public void CONNECTER()
{
if (con.State == ConnectionState.Closed || con.State ==
ConnectionState.Broken)
{
con.ConnectionString = "Data Source=LENOVOPC;Initial
Catalog=TDI;Integrated Security=True";
con.Open();
}
}

// declaration de la methode deconnecter


public void DECONNECTER()
{
if (con.State == ConnectionState.Open)
{

con.Close();
}
}
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="liste
dependantes.aspx.cs" Inherits="walid_houali_control_tdi_202.liste_dependantes" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
.auto-style2 {
width: 269px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="auto-style1">
<tr>
<td class="auto-style2">Choix instance</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" Width="198px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="auto-style2">Choix bd</td>
<td>
<asp:DropDownList ID="DropDownList2" runat="server"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" Width="205px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="auto-style2">choix table</td>
<td>
<asp:DropDownList ID="DropDownList3" runat="server"
Height="16px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
Width="203px">
</asp:DropDownList>
</td>
</tr>
</table>
</div>
<asp:GridView ID="GridView1" runat="server" BackColor="White"
BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged2" Width="343px">
<Columns>
<asp:BoundField HeaderText="empno" />
<asp:BoundField HeaderText="nom" />
<asp:BoundField HeaderText="salaire" />
<asp:BoundField HeaderText="job" />
</Columns>
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<HeaderStyle BackColor="#003399" Font-Bold="True"
ForeColor="#CCCCFF" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399"
HorizontalAlign="Left" />
<RowStyle BackColor="White" ForeColor="#003399" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True"
ForeColor="#CCFF99" />
<SortedAscendingCellStyle BackColor="#EDF6F6" />
<SortedAscendingHeaderStyle BackColor="#0D4AC4" />
<SortedDescendingCellStyle BackColor="#D6DFDF" />
<SortedDescendingHeaderStyle BackColor="#002876" />
</asp:GridView>
<asp:GridView ID="GridView2" runat="server" BackColor="White"
BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4">
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<HeaderStyle BackColor="#003399" Font-Bold="True"
ForeColor="#CCCCFF" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399"
HorizontalAlign="Left" />
<RowStyle BackColor="White" ForeColor="#003399" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True"
ForeColor="#CCFF99" />
<SortedAscendingCellStyle BackColor="#EDF6F6" />
<SortedAscendingHeaderStyle BackColor="#0D4AC4" />
<SortedDescendingCellStyle BackColor="#D6DFDF" />
<SortedDescendingHeaderStyle BackColor="#002876" />
</asp:GridView>
<br />
</form>
</body>
</html>

You might also like