Click here to Skip to main content
15,889,335 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralFile Upload control in Asp .net Page methods Pin
kkrangs28-Sep-12 22:02
kkrangs28-Sep-12 22:02 
GeneralRe: File Upload control in Asp .net Page methods Pin
jkirkerx29-Sep-12 19:30
professionaljkirkerx29-Sep-12 19:30 
GeneralRe: File Upload control in Asp .net Page methods Pin
kkrangs30-Sep-12 22:04
kkrangs30-Sep-12 22:04 
GeneralRe: File Upload control in Asp .net Page methods Pin
jkirkerx1-Oct-12 6:08
professionaljkirkerx1-Oct-12 6:08 
GeneralRe: File Upload control in Asp .net Page methods Pin
jkirkerx1-Oct-12 7:41
professionaljkirkerx1-Oct-12 7:41 
GeneralRe: File Upload control in Asp .net Page methods Pin
kkrangs10-Oct-12 4:44
kkrangs10-Oct-12 4:44 
GeneralRe: File Upload control in Asp .net Page methods Pin
jkirkerx10-Oct-12 6:42
professionaljkirkerx10-Oct-12 6:42 
GeneralRe: File Upload control in Asp .net Page methods Pin
sarathtamil8-Oct-12 23:59
sarathtamil8-Oct-12 23:59 
private void button3_Click(object sender, EventArgs e)
{
try
{
SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\new.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
con.Open();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter("select * from master", con);
da.Fill(dt);
DataRow r = dt.NewRow();
SqlCommand cmd = new SqlCommand("insert into master(itemno,itemname,rate,session) values(" + textBox1.Text + ",'" + textBox2.Text + "'," + textBox3.Text + ",'" + textBox4.Text + "')", con);
cmd.ExecuteNonQuery();
r[4] = convertToByte(textBox6.Text);

dt.Rows.Add(r);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
da.Update(dt);
RefreshData();
con.Close();
MessageBox.Show("picture save in the database");
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
}

private void button5_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox6.Text = Path.GetFullPath(openFileDialog1.FileName);
pictureBox1.ImageLocation = textBox6.Text;
}
}

byte[] convertToByte(string sourcePath)
{
FileInfo fi = new FileInfo(sourcePath);
long sizeByte = fi.Length;
FileStream fs = new FileStream(sourcePath, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] data = br.ReadBytes((int)sizeByte);
return data;
}
GeneralRe: File Upload control in Asp .net Page methods Pin
kkrangs10-Oct-12 5:00
kkrangs10-Oct-12 5:00 
QuestionI am facing error, BC30451: Name 'this' is not declared Pin
Anjani Kant28-Sep-12 20:38
Anjani Kant28-Sep-12 20:38 
AnswerRe: I am facing error, BC30451: Name 'this' is not declared Pin
Sandeep Mewara28-Sep-12 23:26
mveSandeep Mewara28-Sep-12 23:26 
Questionhelp with regular expression Pin
Jassim Rahma28-Sep-12 7:58
Jassim Rahma28-Sep-12 7:58 
AnswerRe: help with regular expression Pin
Richard MacCutchan28-Sep-12 22:20
mveRichard MacCutchan28-Sep-12 22:20 
GeneralRe: help with regular expression Pin
jkirkerx29-Sep-12 19:48
professionaljkirkerx29-Sep-12 19:48 
GeneralRe: help with regular expression Pin
Richard MacCutchan29-Sep-12 21:40
mveRichard MacCutchan29-Sep-12 21:40 
GeneralRe: help with regular expression Pin
jkirkerx30-Sep-12 7:48
professionaljkirkerx30-Sep-12 7:48 
AnswerRe: help with regular expression Pin
jkirkerx29-Sep-12 19:40
professionaljkirkerx29-Sep-12 19:40 
AnswerRe: help with regular expression Pin
Bernhard Hiller30-Sep-12 22:45
Bernhard Hiller30-Sep-12 22:45 
Questiontwo ASPxButton in one line Pin
Jassim Rahma28-Sep-12 6:44
Jassim Rahma28-Sep-12 6:44 
AnswerRe: two ASPxButton in one line Pin
Sandeep Mewara28-Sep-12 23:29
mveSandeep Mewara28-Sep-12 23:29 
AnswerRe: two ASPxButton in one line Pin
gopal pradhan8-Nov-12 23:11
gopal pradhan8-Nov-12 23:11 
QuestionLoop through NavBarItems Pin
Jassim Rahma28-Sep-12 3:40
Jassim Rahma28-Sep-12 3:40 
AnswerRe: Loop through NavBarItems Pin
jkirkerx28-Sep-12 6:22
professionaljkirkerx28-Sep-12 6:22 
QuestionSend mail from gmail account to Bizmail account Pin
Rockstar_28-Sep-12 0:55
professionalRockstar_28-Sep-12 0:55 
AnswerRe: Send mail from gmail account to Bizmail account Pin
n.podbielski28-Sep-12 3:05
n.podbielski28-Sep-12 3:05 

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.