ใครรู้เรียนการเขียน asp.net ด้วย vc# ด้วยหน่อยคับ
พอดีผมมีโค้ด vb แต่ผมต้องเขียนด้วย c# ช่วยทำให้เป็น c# ด้วยนะครับ
Dim path As String = Server.MapPath("~/eOTOP.mdb") Dim provider As String = "Provider=Microsoft.Jet.OleDb.4.0;" & _ "Data Source=" & path Dim conn As New OleDbConnection(provider) Dim id As String = Request.QueryString("id") Dim sql As String = "SELECT Picture FROM Products WHERE ProductID = " & id Dim command As New OleDbCommand(sql, conn) conn.Open() Dim reader As OleDbDataReader = command.ExecuteReader() reader.Read() Response.Clear() Dim strm() As Byte = reader("Picture") Response.OutputStream.Write(strm, 0, strm.Length) conn.Close()
|