Click here to Skip to main content
15,912,504 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDelete files from directory on Application Starts. Pin
Praveen_S5-Oct-06 20:56
Praveen_S5-Oct-06 20:56 
QuestionDisable "Save As" and "Source" in Web Source Pin
Sathiyaraj Ganesan5-Oct-06 20:21
Sathiyaraj Ganesan5-Oct-06 20:21 
AnswerRe: Disable "Save As" and "Source" in Web Source Pin
Guffa5-Oct-06 22:15
Guffa5-Oct-06 22:15 
AnswerRe: Disable "Save As" and "Source" in Web Source Pin
laocat20036-Oct-06 4:49
laocat20036-Oct-06 4:49 
QuestionTime calculation Pin
kirthikirthi5-Oct-06 19:00
kirthikirthi5-Oct-06 19:00 
AnswerRe: Time calculation Pin
vijay25835-Oct-06 20:18
vijay25835-Oct-06 20:18 
GeneralRe: Time calculation Pin
kirthikirthi6-Oct-06 1:19
kirthikirthi6-Oct-06 1:19 
Questiondisplaying image from database problem !! urgent !!! Pin
vijay25835-Oct-06 17:15
vijay25835-Oct-06 17:15 
hi iam storing binary format of the images in db.Now i want to display them on my page with other details.Actually my db table contains many fields .on datagrid iam displaying twofields like eno,ename...and i have taken two link buttons (view and modify)view is to view the full details of the particular employee.when the user click the view link the details will be shown in new seperate window(target=_blank).here my image are displaying properly for all the records.My problem is with modify link.when user click the modify link iam displaying all the details for modification in nxtpage(target=_self). .here my image is not displaying properly.first time for accessing the record it is displaying the image properly.if i am going for another record for modification it is showing only the previous image.if iam refreshing the page then only it is showing the particular image properly how to rectify this problem.whether i have to clean browser cache for every request.If yes how?
// here is my code

private void Page_Load(object sender, System.EventArgs e)
{


int Eno;

Eno = int.Parse(Request.QueryString.Get("eno"));

try
{

if (!Page.IsPostBack)
{
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["strConn"]);
SqlCommand cmd = new SqlCommand("select ENO,ENAME,GENDER,EDOB,EAGE,EDOJ,ESALARY,EPHONE,EADDR,EPHOTO from register where ENO="+ Eno +"",conn);
SqlDataReader dr;
conn.Open();
dr = cmd.ExecuteReader();
dr.Read();
Employno1.Text = dr[0].ToString();
Employname1.Text = dr[1].ToString();

string Gendervalue = dr[2].ToString();

Gendervalue=Gendervalue.TrimEnd();
//Response.Write("|" + Gendervalue + "|");
if (Gendervalue.Equals("male"))
{
RadioButton1.Checked = true;
RadioButton2.Checked = false;
}
else
{
RadioButton2.Checked = true;
RadioButton1.Checked = false;
}
//string exdate = dr[3].ToString();
Employdob1.Text = dr[3].ToString();
Employage1.Text = dr[4].ToString();
Employdoj1.Text = dr[5].ToString();
Employsalary1.Text = dr[6].ToString();
Employphno1.Text = dr[7].ToString();
Employaddress1.Text = dr[8].ToString();

// Create a new stream to load this photo into
FileStream stream = new FileStream("c:/inetpub/wwwroot/Project1/personimage2.bmp",FileMode.OpenOrCreate,FileAccess.Write);
BinaryWriter bw = new BinaryWriter(stream);
byte[] buffer = new byte[stream.Length];
buffer = (byte[])dr[9];
bw.Write(buffer);
bw.Close();
stream.Close();
Image1.ImageUrl="http://new4/Project1/personimage2.bmp";

dr.Close();
conn.Close();
}
}
catch(Exception ex)
{

Response.Write(ex.Message);
}
}

thanks

vijay
AnswerRe: displaying image from database problem !! urgent !!! Pin
Deepak the Cool5-Oct-06 22:08
Deepak the Cool5-Oct-06 22:08 
Question.Net version of PHPMyAdmin ? Pin
digsy_5-Oct-06 16:35
digsy_5-Oct-06 16:35 
AnswerRe: .Net version of PHPMyAdmin ? Pin
Jon Sagara5-Oct-06 19:02
Jon Sagara5-Oct-06 19:02 
AnswerRe: .Net version of PHPMyAdmin ? Pin
Britney S. Morales6-Oct-06 11:17
Britney S. Morales6-Oct-06 11:17 
QuestionHyperLink Field Problem Pin
shapper5-Oct-06 15:51
shapper5-Oct-06 15:51 
AnswerRe: HyperLink Field Problem Pin
shapper6-Oct-06 1:49
shapper6-Oct-06 1:49 
QuestionMaintain a dataset across the app, what is the best way? Pin
littlecuttiepie5-Oct-06 12:16
littlecuttiepie5-Oct-06 12:16 
AnswerRe: Maintain a dataset across the app, what is the best way? Pin
Mike Ellison5-Oct-06 14:31
Mike Ellison5-Oct-06 14:31 
AnswerRe: Maintain a dataset across the app, what is the best way? Pin
Britney S. Morales6-Oct-06 11:20
Britney S. Morales6-Oct-06 11:20 
Questionneed help wit files settings pls!! Pin
neodeaths5-Oct-06 12:14
neodeaths5-Oct-06 12:14 
AnswerRe: need help wit files settings pls!! Pin
Mike Ellison5-Oct-06 14:33
Mike Ellison5-Oct-06 14:33 
GeneralRe: need help wit files settings pls!! Pin
neodeaths5-Oct-06 18:11
neodeaths5-Oct-06 18:11 
GeneralRe: need help wit files settings pls!! Pin
Mike Ellison6-Oct-06 6:02
Mike Ellison6-Oct-06 6:02 
GeneralRe: need help wit files settings pls!! Pin
neodeaths6-Oct-06 8:18
neodeaths6-Oct-06 8:18 
GeneralRe: need help wit files settings pls!! Pin
Mike Ellison6-Oct-06 8:40
Mike Ellison6-Oct-06 8:40 
GeneralRe: need help wit files settings pls!! Pin
neodeaths7-Oct-06 3:24
neodeaths7-Oct-06 3:24 
GeneralRe: need help wit files settings pls!! Pin
neodeaths13-Oct-06 17:40
neodeaths13-Oct-06 17:40 

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.