Click here to Skip to main content
15,884,388 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Web Based chat application for intranet website using C# + Ms SQl 2005 as database Pin
Brij6-Mar-10 8:33
mentorBrij6-Mar-10 8:33 
AnswerRe: Web Based chat application for intranet website using C# + Ms SQl 2005 as database Pin
Sandeep Mewara7-Mar-10 6:53
mveSandeep Mewara7-Mar-10 6:53 
QuestionCreating a dynamically expanding div tag Pin
AndyASPVB6-Mar-10 6:59
AndyASPVB6-Mar-10 6:59 
AnswerRe: Creating a dynamically expanding div tag Pin
John Bracey6-Mar-10 7:12
John Bracey6-Mar-10 7:12 
GeneralRe: Creating a dynamically expanding div tag Pin
AndyASPVB7-Mar-10 0:23
AndyASPVB7-Mar-10 0:23 
GeneralRe: Creatinhttp://www.codeproject.com/script/Forums/Edit.aspx?fid=12076&select=3394011&floc=/Forums/12076/ASP-NET.aspx&action=rg a dynamically expanding div tag Pin
John Bracey7-Mar-10 1:29
John Bracey7-Mar-10 1:29 
AnswerRe: Creating a dynamically expanding div tag Pin
carlecomm7-Mar-10 15:32
carlecomm7-Mar-10 15:32 
Questionupload file to sql server using asp.net and vb.net Pin
oedipusrex6-Mar-10 5:29
oedipusrex6-Mar-10 5:29 
i found this code to upload a file into a sql database using the asp.net fileupload object (or vb)
i found it here

http://forums.asp.net/p/1480079/3451771.aspx

i think it works, but i am a learning noob and have a question...where does my dbase info go in the code?

1. If FleUpload.HasFile Then
2. Dim fileName As String = Server.HtmlEncode(FleUpload.FileName)
3. Dim extension As String = System.IO.Path.GetExtension(fileName)
4. If (extension.ToUpper = ".JPG") Or (extension.ToUpper = ".GIF") Then
5.
6. '**** Resize image section ****
7. Dim image_file As System.Drawing.Image = System.Drawing.Image.FromStream(FleUpload.PostedFile.InputStream)
8. Dim image_height As Integer = image_file.Height
9. Dim image_width As Integer = image_file.Width
10. Dim max_height As Integer = 120
11. Dim max_width As Integer = 160
12.
13.
14. image_height = (image_height * max_width) / image_width
15. image_width = max_width
16.
17. If image_height > max_height Then
18. image_width = (image_width * max_height) / image_height
19. image_height = max_height
20. Else
21. End If
22.
23.
24. Dim bitmap_file As New Bitmap(image_file, image_width, image_height)
25. Dim stream As New System.IO.MemoryStream
26.
27. bitmap_file.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg)
28. stream.Position = 0
29.
30. Dim data(stream.Length) As Byte
31. stream.Read(data, 0, stream.Length)
32. '**** End resize image section ****
33.
34.
35. Dim myConn As New SqlConnection(ConfigurationManager.ConnectionStrings("cs").ConnectionString)
36. Dim mycmd As New SqlCommand("se_equipmentimages_insert", myConn)
37. mycmd.CommandType = CommandType.StoredProcedure
38.
39. mycmd.Parameters.AddWithValue("@equipment_id", id)
40. mycmd.Parameters.AddWithValue("@image_file", data)
41.
42. Try
43. myConn.Open()
44. mycmd.ExecuteNonQuery()
45. Catch ex As Exception
46. Finally
47. myConn.Close()
48. End Try
49.
50. Else
51. lblError.Text = "Please only upload .jpg or .gif files"
52. lblError.Visible = True
53. End If
54. Else
55. lblError.Text = "No file selected"
56. lblError.Visible = True
57. End If

to wit...

dbase name: mydBase
table name: dBaseTable
column names :fileOne, fileTwo, fileThree

where in the code above does this go?
also, how does this code work for multiple fileuploads at once?

thanks

james
AnswerRe: upload file to sql server using asp.net and vb.net Pin
Muhammad Gouda6-Mar-10 23:07
Muhammad Gouda6-Mar-10 23:07 
AnswerRe: upload file to sql server using asp.net and vb.net Pin
Abhinav S6-Mar-10 23:32
Abhinav S6-Mar-10 23:32 
QuestionHow to Fast Page Redirect ? Pin
Manish_Kumar_Nayak6-Mar-10 0:50
Manish_Kumar_Nayak6-Mar-10 0:50 
AnswerRe: How to Fast Page Redirect ? Pin
Abhijit Jana6-Mar-10 1:50
professionalAbhijit Jana6-Mar-10 1:50 
GeneralRe: How to Fast Page Redirect ? Pin
Manish_Kumar_Nayak8-Mar-10 0:25
Manish_Kumar_Nayak8-Mar-10 0:25 
AnswerRe: How to Fast Page Redirect ? Pin
carlecomm7-Mar-10 15:36
carlecomm7-Mar-10 15:36 
AnswerRe: How to Fast Page Redirect ? Pin
carlecomm7-Mar-10 16:00
carlecomm7-Mar-10 16:00 
GeneralRe: How to Fast Page Redirect ? Pin
Manish_Kumar_Nayak8-Mar-10 0:30
Manish_Kumar_Nayak8-Mar-10 0:30 
AnswerRe: How to Fast Page Redirect ? Pin
tunsten8-Mar-10 5:57
tunsten8-Mar-10 5:57 
QuestionMultiview Problem Pin
Rock Star.6-Mar-10 0:25
Rock Star.6-Mar-10 0:25 
AnswerRe: Multiview Problem Pin
Brij6-Mar-10 5:55
mentorBrij6-Mar-10 5:55 
QuestionPaging and Sorting Pin
SreejithKumar M6-Mar-10 0:04
SreejithKumar M6-Mar-10 0:04 
AnswerRe: Paging and Sorting Pin
Pranay Rana6-Mar-10 0:11
professionalPranay Rana6-Mar-10 0:11 
AnswerRe: Paging and Sorting Pin
Brij6-Mar-10 0:11
mentorBrij6-Mar-10 0:11 
AnswerRe: Paging and Sorting Pin
Abhijit Jana6-Mar-10 1:47
professionalAbhijit Jana6-Mar-10 1:47 
AnswerRe: Paging and Sorting Pin
carlecomm8-Mar-10 15:03
carlecomm8-Mar-10 15:03 
Questioniam using visual studio 2005 with ajax control library but after design the form during runtime form is displaying blank page Pin
developerit5-Mar-10 20:51
developerit5-Mar-10 20:51 

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.