|
why don't u show the full text in a tool tip ..?
Koushik
|
|
|
|
|
Already i am showing a text in tooltip. Tooltip aleady holds a value. I cannot use tooltip
Thanks,
Srikanth
|
|
|
|
|
dude! i think u have to do this using javascript...identify the id of the and then increase the width of the cell on mouseover ...again restore the width to normal on mouseout...
Koushik
|
|
|
|
|
I don't know is it possible or not but increasing the width of table cell not only affect that cell but whole table. As Kaushik said its better to show it in tooltip.
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Tooltip is an option which i can go for. But tool tip aleady holds a value. I thought of showing the full text with a appearance like the cell getting a zoom like thing.
Did you get me. In some pages i hope you would have seen on mouse over the control gets zoomed a bit. Thought of trying that.
Thanks,
Srikanth
|
|
|
|
|
i understood what you want to implement could you give me the link or url where you saw this ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Any one u Guys can tell
How to Use Edit/Delete Items In Repeater Control
prabumj@gmail.com
|
|
|
|
|
The repeater doesn't support anything like that, you'd be writing it entirly from scratch yourself. The strength of the repeater is it is simple, and therefore easy to modify
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
If you want to Edit/Delete the Items in a DataControl Use DataList. Because Repeater Control doesn't comes with the provision of EditItem Template.
Regards - J O N -
|
|
|
|
|
how to retrive images from sql database which is already strored, and show in image componet, using asp.net with c#.
i have used this code for storing image to database. this code store images in database, but i dont know that how to retrive it and show in an image component
protected void Button1_Click(object sender, EventArgs e)
{
int ImgLen = FileUpload1.PostedFile.ContentLength;
string strSQL = "";
byte[] FileImg = new byte[ImgLen];
FileUpload1.PostedFile.InputStream.Read(FileImg, 0, ImgLen);
// Inserting the image to DB
try
{
con.Open();
strSQL = "INSERT INTO Table1 (image) VALUES (@pic)";
SqlCommand cmd = new SqlCommand(strSQL, con);
cmd.Parameters.AddWithValue("@pic", FileImg);
cmd.ExecuteNonQuery();
}
finally
{
con.Close();
}
}
yogesh
|
|
|
|
|
yogesh_softworld123 wrote: how to retrive images from sql database which is already strored, and show in image componet, using asp.net with c#.
How to google[^] for retrive images from sql database which is already strored, and show in image componet, using asp.net with c# ?
|
|
|
|
|
You might have saved those images in a table.If it is so, u can just retrieve them by using datareader . It is similar to how u retrieve data from the table using datareader. You just mention the column name.
Thank u
|
|
|
|
|
Re: how to retrive images from sql database which is already strored, and show in image componet, using asp.net with c#
yogesh
|
|
|
|
|
I seem to tell people this daily. To pass an image into a webpage, it needs to exist on the file systme, so you should store paths in your DB.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Christian Graus wrote: it needs to exist on the file systme
It doesn't (disagreeing with CG?? - Any credibility I had may now hit the deck.....).
I store images of all our staff in SQL database, and generate an ImageURL on the fly.
<br />
Image img = new Image();<br />
img.ImageURL = "~\ImageBuilder.Aspx?staffID=1234";<br />
The ImageBuilder page retrieves teh binary data from the SQL, and writes it out in the Response . No files are saved anywhere. I don't have the code to hand else I would post it.
-- modified at 3:41 Wednesday 24th October, 2007
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
write the code to retrieve the image from the Database and store it in Byte[] array. Set the Content Type of the Reponse Object - Response.ContentType = "image/gif" and then write out the Binary Data using the Response.Binary()
Regards - J O N -
|
|
|
|
|
Hi JON Prabhu
I am using ASP.NEt,VB.NET to save and reteive the images from DB, i recently posted in Vb.NEt forum the Same and as Christian suggested i used file system to retrive image using file system and only storing path in DB. it getting saved and retrive.
But still i am trying to know how to retrieve the image from DB here is the sample code i have used to retrive image form DB but i am only getting the imagebox with crossed but not image is getting showed.
<br />
<br />
Private Sub btnRetrive_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRetrive.Click<br />
Dim sqlconn As New SqlConnection(ConfigurationSettings.AppSettings("BILL_CONSTR"))<br />
Dim sqlcommand As New SqlCommand("select PersonImage from dbo.Person where PersonID=3", sqlconn)<br />
Try<br />
sqlconn.Open()<br />
Dim SqlData As SqlDataReader<br />
SqlData = sqlcommand.ExecuteReader(CommandBehavior.CloseConnection)<br />
Do While (SqlData.Read())<br />
Response.ContentType = "image/gif"<br />
Response.BinaryWrite(SqlData.Item("PersonImage"))<br />
Loop<br />
sqlconn.Close()<br />
Catch SQLex As SqlException<br />
Response.Write("Insert Failed. Error Details are: " & SQLex.ToString())<br />
<br />
End Try<br />
End Sub<br />
<br />
<br />
<br />
<br />
sathimailin
|
|
|
|
|
The code which you have written seems correct. It should probably work. Just put a break point and do a step-wise execution and check whether the execution reaches the code Response.Binarywrite() .
Regards - J O H N -
|
|
|
|
|
hi Prabhu,
Its getting executed and i am getting a page with only image box not an image shown but passes all the code lines and when i right click and see the properties
it shows not avalable.
sathimailin
|
|
|
|
|
I suppose the Image is not Uploaded properly. Just Try uploading a new Image file and check with it. below is a sample code which works well in one of my project.
Response.ClearHeaders()<br />
Response.Cache.SetNoStore()<br />
Response.ContentType = "image/gif"<br />
Response.BinaryWrite(lImageDataset.Tables(0).Rows(0)(0))
Regards - J O H N -
|
|
|
|
|
THanks Jon
i will try with new one
|
|
|
|
|
You are welcome
Regards - J O H N -
|
|
|
|
|
Hi Jon
yes ,Thanks for the help , i have got the image from DB but altered with some codes please check this
but still i have to go around with some things like i am getting only one image for display.so i am working on it if u have some idea please let me know.
<br />
'Using DB To Store Image IN Database<br />
Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click<br />
<br />
Dim oStrPostedFileName, oStrFileName<br />
Dim oBinaryReader As BinaryReader<br />
Dim fs As FileStream<br />
<br />
intImageSize = fileUploadCTRL.PostedFile.ContentLength<br />
strImagetype = fileUploadCTRL.PostedFile.ContentType<br />
ImageStream = fileUploadCTRL.PostedFile.InputStream<br />
oStrPostedFileName = System.IO.Path.GetFullPath(fileUploadCTRL.Value)<br />
<br />
Dim ImageContent(intImageSize) As Byte<br />
intsize = ImageStream.Read(ImageContent, 0, intsize)<br />
<br />
<br />
<br />
fs = New FileStream(oStrPostedFileName, FileMode.Open, FileAccess.Read)<br />
Dim MyData(fs.Length) As Byte<br />
<br />
oBinaryReader = New BinaryReader(fs)<br />
ImageContent = oBinaryReader.ReadBytes(CType(fs.Length, Integer))<br />
oBinaryReader.Close()<br />
fs.Close()<br />
<br />
Dim sqlconn As New SqlConnection(ConfigurationSettings.AppSettings("BILL_CONSTR1"))<br />
sqlconn.Open()<br />
<br />
Dim sqlcommand As New SqlCommand("sp_Image", sqlconn)<br />
sqlcommand.CommandType = CommandType.StoredProcedure<br />
sqlcommand.Parameters.Add(New SqlParameter("@PersonImage", SqlDbType.Image))<br />
sqlcommand.Parameters("@PersonImage").Value = ImageContent<br />
sqlcommand.ExecuteNonQuery()<br />
Response.Write("New Image Added Successfully")<br />
End Sub<br />
<br />
'Reteriving From DB<br />
Private Sub btnRetrive_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRetrive.Click<br />
Dim sqlconn As New SqlConnection(ConfigurationSettings.AppSettings("BILL_CONSTR1"))<br />
Dim ds As New DataSet<br />
Dim i As Integer<br />
Dim da As New SqlDataAdapter("select PersonImage from Contacts.dbo.Person where pid in(1,2,3)", sqlconn)<br />
Try<br />
sqlconn.Open()<br />
da.Fill(ds)<br />
For i = 0 To ds.Tables(0).Rows.Count - 1<br />
<br />
Response.ClearHeaders()<br />
Response.Cache.SetNoStore()<br />
Response.ContentType = "image/gif"<br />
Response.BinaryWrite(ds.Tables(0).Rows(i).Item("PersonImage"))<br />
Next<br />
<br />
Catch ex As Exception<br />
ex.Message.ToString()<br />
Finally<br />
sqlconn.Close()<br />
End Try<br />
End Sub<br />
<br />
End Class<br />
i Have three image in DB and need to display.
sathimailin
|
|
|
|
|
Retriving more than one Image and looping through the Images is of no use. Anyway your Response.Binary() will write to the client once. Next time when you again execute the Response.binary() it will overwrite. It would be better if you seperate the Image retriving code in a seperate class file and use it. And Most importantly read some articles about 3-Tier Architecture and try to seperate your DataAccess code from Presentation Layer.
Regards - J O H N -
|
|
|
|
|
hi Jon
Thanks for your reply and Tips i will work on using Layers and if u have any good link for practicing layers let me know i want some links.
sathimailin
|
|
|
|