Click here to Skip to main content
15,920,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to upload a file to my webserver from another url? Pin
sathesh pandian27-Jun-07 19:24
sathesh pandian27-Jun-07 19:24 
GeneralRe: How to upload a file to my webserver from another url? Pin
InvalidTypecast28-Jun-07 4:18
InvalidTypecast28-Jun-07 4:18 
QuestionThe system cannot find the file specified error occurs! Pin
rkherath24-Jun-07 17:35
rkherath24-Jun-07 17:35 
AnswerRe: The system cannot find the file specified error occurs! Pin
Christian Graus24-Jun-07 17:48
protectorChristian Graus24-Jun-07 17:48 
GeneralRe: The system cannot find the file specified error occurs! Pin
rkherath24-Jun-07 18:54
rkherath24-Jun-07 18:54 
QuestionEmail using gmail Pin
Tim_Thomas24-Jun-07 15:35
Tim_Thomas24-Jun-07 15:35 
AnswerRe: Email using gmail Pin
Sathesh Sakthivel24-Jun-07 16:27
Sathesh Sakthivel24-Jun-07 16:27 
QuestionSeeking help with Data Reader Pin
minibansal24-Jun-07 8:00
minibansal24-Jun-07 8:00 
Hello,
In my asp.net project's first page Form1.aspx, i am using a datagrid control which has a hyperlink column bound with Employee Code which gets its data from a SQL Server Database. When the user clicks the employee code, a new form Form2.aspx opens which should display all the Form1 data inside several control.
I am using a query string to transfer the employee code (EmpCode) into the next page and storing it into a variable (empcode). In next page i am using a data reader to fetch the data from the database by passing the stored variable empcode in the select statement.
My Problem is that I am unable to display the fetched values from the database into the lable controls using data reader. The code I am using is:


string empcode;

protected void Page_Load(object sender, EventArgs e)
{
empcode = Request.QueryString[0];
SqlConnection conn = new SqlConnection("Data Source=SID-710D1046244;Initial Catalog=Training;Integrated Security=True");
SqlDataReader dr;
SqlCommand cmd = new SqlCommand();

cmd.CommandText = "Select * From [Training] Where EmpCode=@empcode";
cmd.Parameters.Insert("@empcode").SqlDbType.varchar,50).Value = empcode;
cmd.Connection = conn;
conn.Open();

dr = cmd.ExecuteReader();

while (dr.Read())
{
Label2.Text = dr.GetString(0);
Label3.Text = dr.GetString(1);
Label4.Text = dr.GetSqlInt32(2); // It Contains a numeric value
Label5.Text = dr.GetSqlBoolean(3); //It Contains a boolean value
Label6.Text = dr.GetString(4);
}


Please Please Help Me. Any kind of Help is greatly AppriciatedSmile | :)



Thanks & regards,
Mini

AnswerRe: Seeking help with Data Reader Pin
El Fenomeno24-Jun-07 8:26
El Fenomeno24-Jun-07 8:26 
GeneralRe: Seeking help with Data Reader Pin
minibansal24-Jun-07 8:44
minibansal24-Jun-07 8:44 
GeneralRe: Seeking help with Data Reader Pin
doWhileSomething24-Jun-07 9:06
doWhileSomething24-Jun-07 9:06 
GeneralRe: Seeking help with Data Reader Pin
DavidNohejl24-Jun-07 9:09
DavidNohejl24-Jun-07 9:09 
GeneralRe: Seeking help with Data Reader Pin
Nouman Bhatti24-Jun-07 20:39
Nouman Bhatti24-Jun-07 20:39 
QuestionTreeView - Page callback Pin
El Fenomeno24-Jun-07 6:32
El Fenomeno24-Jun-07 6:32 
AnswerRe: TreeView - Page callback Pin
El Fenomeno13-Jul-07 10:28
El Fenomeno13-Jul-07 10:28 
Questionmaster page problem Pin
rcwoods24-Jun-07 6:01
rcwoods24-Jun-07 6:01 
AnswerRe: master page problem Pin
Sathesh Sakthivel24-Jun-07 6:02
Sathesh Sakthivel24-Jun-07 6:02 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 6:15
rcwoods24-Jun-07 6:15 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 7:20
rcwoods24-Jun-07 7:20 
AnswerRe: master page problem Pin
doWhileSomething24-Jun-07 9:03
doWhileSomething24-Jun-07 9:03 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 10:11
rcwoods24-Jun-07 10:11 
GeneralRe: master page problem Pin
doWhileSomething24-Jun-07 10:26
doWhileSomething24-Jun-07 10:26 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 10:42
rcwoods24-Jun-07 10:42 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 10:48
rcwoods24-Jun-07 10:48 
GeneralRe: master page problem Pin
doWhileSomething24-Jun-07 10:50
doWhileSomething24-Jun-07 10:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.