SqlCommand cmdSelect=new SqlCommand("select Picture from tblImgData where ID=@ID",this.sqlConnection1);
cmdSelect.Parameters.Add("@ID",SqlDbType.Int,4);
cmdSelect.Parameters["@ID"].Value=this.editID.Text;
this.sqlConnection1.Open();byte[] barrImg=(byte[])cmdSelect.ExecuteScalar();
string strfn=Convert.ToString(DateTime.Now.ToFileTime());
FileStream fs=new FileStream(strfn,FileMode.CreateNew,FileAccess.Write);
fs.Write(barrImg,0,barrImg.Length);
fs.Flush();
fs.Close();
pictureBox1.Image=Image.ఫ్రం
File(strfn);
---------------------
http://www.odetocode.com/Articles/172.aspx
---------------------
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim myCommand As SqlCommand = New SqlCommand("sp_das_person_real_images_sel", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Try
myConnection.Open()
DG_Persons.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
DG_Persons.DataBind()
Catch
SQLexc As SqlException
Response.Write("Error occured while Generating Data. Error is " & SQLexc.ToString())
End Try
Tuesday, April 22, 2008
javascript
How to hide a button:
-----------------------
function hide()
{
document.form1.check.style.visibility = 'hidden';
return;
}
----------------------
Call the above function in button Onclick="hide();"
-----------------------
function hide()
{
document.form1.check.style.visibility = 'hidden';
return;
}
----------------------
Call the above function in button Onclick="hide();"
Chat Programm in ASP.NET
How to open filedialog in web applications
call below function when u need to open dialog box
DisplayDownloadDialog("MyDown.doc")
----------------------------------------------------------
Sub DisplayDownloadDialog(ByVal PathVirtual As String)
Dim strPhysicalPath As String
Dim objFileInfo As System.IO.FileInfo
Try
strPhysicalPath = Server.MapPath(PathVirtual)
'exit if file does not exist
If Not System.IO.File.Exists(strPhysicalPath) Then Exit Sub
objFileInfo = New System.IO.FileInfo(strPhysicalPath)
Response.Clear()
'Add Headers to enable dialog display
Response.AddHeader("Content-Disposition", "attachment; filename=" & objFileInfo.Name)
Response.AddHeader("Content-Length", objFileInfo.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.WriteFile(objFileInfo.FullName)
Catch
'on exception take no action
'you can implement differently
Finally
Response.End()
End Try
End Sub
DisplayDownloadDialog("MyDown.doc")
----------------------------------------------------------
Sub DisplayDownloadDialog(ByVal PathVirtual As String)
Dim strPhysicalPath As String
Dim objFileInfo As System.IO.FileInfo
Try
strPhysicalPath = Server.MapPath(PathVirtual)
'exit if file does not exist
If Not System.IO.File.Exists(strPhysicalPath) Then Exit Sub
objFileInfo = New System.IO.FileInfo(strPhysicalPath)
Response.Clear()
'Add Headers to enable dialog display
Response.AddHeader("Content-Disposition", "attachment; filename=" & objFileInfo.Name)
Response.AddHeader("Content-Length", objFileInfo.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.WriteFile(objFileInfo.FullName)
Catch
'on exception take no action
'you can implement differently
Finally
Response.End()
End Try
End Sub
Cursors
Static cursors
Dynamic cursors
Forward-only cursors
Keyset-driven cursors
Dynamic cursors
Forward-only cursors
Keyset-driven cursors
Static cursors:
A static cursor always displays the result set as it was when the cursor was opened. Static cursors are always read-only.
Dynamic Cursors:
Dynamic cursors are the opposite of static cursors. Dynamic cursors reflect all changes made to the rows in their result set when scrolling through the cursor.
Forward-only Cursors:
A forward-only cursor does not support scrolling; it supports only fetching the rows serially from the start to the end of the cursor.
Keyset-driven Cursors:
The keyset is the set of the key values from all the rows that qualified for the SELECT statement at the time the cursor was opened
Subscribe to:
Posts (Atom)