-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmedicos.aspx.cs
69 lines (55 loc) · 2.13 KB
/
medicos.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Configuration;
using System.Data;
namespace ASPNET_Odonto
{
public partial class medicos : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string key = ConfigurationManager.ConnectionStrings["mysqlConn"].ConnectionString;
MySqlConnection con = new MySqlConnection(key);
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "SP_Iniciar_Sesion";
cmd.Parameters.Add("@usuario", MySqlDbType.VarChar, 15).Value = "admin";
cmd.Parameters.Add("@pass", MySqlDbType.VarChar, 15).Value = "admin";
cmd.Connection.Open();
MySqlDataReader dReader = cmd.ExecuteReader();
Response.Write("<table class='table table-bordered tablehover' border='1'><tr>");
for (int i = 0; i < dReader.FieldCount; i++) {
Response.Write("<th align='center' bgcolor='#eeeeee'>");
Response.Write(dReader.GetName(i));
Response.Write("</th>");
}
Response.Write("<th align='center' bgcolor='#eeeeee'>" +
"Accion </h>");
Response.Write("</tr>");
while (dReader.Read())
{
//Console.WriteLine("User's last sign in was: " + rdr["lastin"]);
Response.Write("<tr>");
for (int i = 0; i < dReader.FieldCount; i++)
{
Response.Write("<td align='center' bgcolor='#eeeeee'>");
Response.Write(dReader[dReader.GetName(i)]);
Response.Write("</td>");
}
Response.Write("<tr>");
}
dReader.Close();
cmd.Connection.Close();
}
protected void BtnRegistrarMed(object sender, EventArgs e)
{
}
}
}