|
Nope.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi;
I have a field of type 'image' in a table where files are stored in binary form. How would I download the file in its actual form in vb.net or ASP.NET.
I use the ADODB.STREAM CLASS in Visual Basic 6 for this purpose but having problem in ASP.NET
BYE
|
|
|
|
|
Put this code in your page
Dim oAttachment As New GetAttach
Try
Me.Page.Response.Clear()
Me.Page.Response.ClearContent()
Me.Page.Response.ClearHeaders()
Response.ContentType = ""
Response.BinaryWrite(oAttachment.GetAttach(<The Id of your stored file>))
Response.AddHeader("content-disposition", "attachment; filename=" + oAttachment.ATTACH_NAME + "." + oAttachment.EXTENSION)
Me.Page.Response.End()
Catch ex As Exception
throw ex
End Try
GetAttach Class to call getter stored procedure
Public Function GetAttach(ByVal MyParameter As Integer)
Dim docFileReader As SqlDataReader
Try
Dim Myadapter As New SqlDataAdapter
Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Using command As New SqlCommand("GetAttachment", connection)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add(New SqlParameter("@MY_SP_PARAMETER", MyParameter))
connection.Open()
docFileReader = command.ExecuteReader
docFileReader.Read()
EXTENSION = docFileReader.Item("EXTENSION").ToString
ATTACH_NAME = docFileReader.Item("ATTACH_NAME").ToString
WEIGHT = docFileReader.Item("WEIGHT").ToString
Dim FileData(docFileReader.GetBytes(0, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
docFileReader.GetBytes(0, 0, FileData, 0, FileData.Length)
docFileReader.Close()
Return FileData
End Using
End Using
Catch ex As Exception
If IsNothing(docFileReader) = False Then
docFileReader.Close()
End If
Throw ex
End Try
End Function
|
|
|
|
|
How to create a page in which there is a static panels that remains static even if the page moves.
punam
|
|
|
|
|
Set the panel's max and min size to be the size you want.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If u want the panels to change and be related to the form...u may set the dock and anchor properties to the right selection.
and vise versa if u want the plane to be static and not changing its size even if the form's size had been changed, then u also go to the dock and anchor and set default selection for both of them
|
|
|
|
|
hello all,
am creating one application using vb.net 2005. my problem is in text boxes i have given tabindexes. but whenever i run that application and press the tab key it was not in index manner(goto first then second then some buttons and then third...) how to rectify this problem? my application contain 32 fields in one form.
and also some validation controls not working propherly. ie if first text box is blank in save button press it was shown the particular box is empty please fill but in other textboxes it was not shown error messages. how to wrote common validation for this purpose? please help me....
|
|
|
|
|
The tab order works, you need to check how you've set it.
We also need to see your code to understand why you're not using the validation controls properly, to get the result you want. The best way to do what you're saying is to have a validation summary control on the page.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
checking means am i create tabindexes serially or not? s am create taidexes serially textbox1 got tabindex1 and textbox2 got tabindex2 like wise am creating tabindex for buttons also. what i do now? and if my checkings r wrong means how do i check it? Please help me to solve the issue..
|
|
|
|
|
If this is dotnet are you using the 'tab order' wizard under the 'view' menu? or are you creating controls at run-time?
if your using vb6 then go in reverse order and set every tabindex to '0'. that will auto-increment every control's tab index that you set before the last one you set to '0'. or are you creating controls at run-time?
|
|
|
|
|
hello frnd,
thanks it is now working fine...
|
|
|
|
|
Hi all, I've stumbled onto a problem I can't find a solution to.
I have a custom data grid that has a auto complete feature. This feature needs to look at the data for the current document (this is not a sql type grid.) Since the program is a MDI interface, i have a set of variables that serve as the common point for any member that needs data about the current document.
The problem i have run into is that I need to reload the variables that are pointing to the common point variables when the current document changes, rather than just changing the common document pointers.
If this isn't clear:
Display-------->Selected document---------------->document collection
I want to make the display look at the selected document address, rather than the data in the document collection.
I've read the marshalling info, but since this is an auto-complete that is updated with info, it appears that copying to unmanaged memory will not solve the issue.
Anyone have any ideas short of creating a delegate function?
Thanks,
Tom
|
|
|
|
|
Your description of the problem is making the assumption that we know how you designed your app, so this is a generalization.
The "current document" in an application would normally be a pointer to an instance of the document. You wouldn't normally have to set any "global" variables to match the document since each document class would be keeping track of all the data that is specific to that document. The "current document" pointer would be used to get at that data.
If your document class implements callbacks, or some other methods or async methods, delegates would be the best way to go.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I not sure y everytime i pass the data from DATAGRID to EXCEL above more then 10 row then the datagrid pointer will skip after row 10 until the end.
So my excel will look like this let said u use number as the data value.i showing 1-15 data.
1
2
3
4
5
6
7
8
9
10
15
15
15
15
15
I just found the solution , wat a crazy solution i never expect.
I just drag the datagrid height longer then solve the problem .HAH!;P
-- modified at 21:16 Thursday 7th December, 2006
|
|
|
|
|
You have asked this question any number of times... did you actually debug and see what happens when the row becomes 10 or 11?
|
|
|
|
|
there is no coding error at all i found out ! i solve it by only draging the data grid height longer! oh my..
|
|
|
|
|
Are you sure just increasing the height would do it, then? What happens if the number of rows increased to, say, 100?
|
|
|
|
|
yes, recently the data i passing not really reach until 100. But u r, u may try go to the datagrid properties change the row length small, normally is 200 so maybe u try 100-50 u can see the row size was squez smaller. so that mean the Height of ur datagrid can contain more row inside.
Cause i found out if my height is smaller then the data which suppose to show. Let said
My datagrid height just able to show 10 row at one time.Even datagrid able for u to click scroll down to next row but it will have problem when passing to EXCEL.
so i just drag the height higher to able to show all the data out without using the scoll. Hope u understand wat i mean...
|
|
|
|
|
That is not really going to solve your problem, I think. What if you are unable to predict the number of rows that your data grid will display? You cannot infinitely decrease the row height...
|
|
|
|
|
can predict by some measurement of course, anyway is already solve already been tested the system.thanks anyway.
|
|
|
|
|
Looking at some of your previous questions you have a habit of adding 'urgent' to the title.
____________________________________________________
If at first you don't succeed, skydiving might not be for you.
|
|
|
|
|
leckey wrote: some of your previous questions you have a habit of adding 'urgent' to the title.
I know, it's getting old. Hey, I need financial freedom [Urgent] :->
You will see a delete button on each of your posts. Press it. - Colin Angus Mackay
|
|
|
|
|
cause is very urgent, but anyway i solve most of it myself. maybe just to express some stress in the forum then
|
|
|
|
|
Well, "urgent" doesn't have any meaning in the forums. Noone is going to scan the subjects and immediately go to the ones that say "urgent!". Noone just sits here waiting for the next post to show up so they can just jump right on it.
If your question was that urgent, your best source of information is Google or staying up yourself until 3:00am pounding on the problem until you get it solved.
Actually, putting "urgent" in your subject line, or anywhere else in your post, will likely get you ignored for a while!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i learn to put this urgent is because i saw ppl do it.
sure i woundnt sit and wait anwser while i doing research and i wait anyone able to find out the solution more faster then me, anyway now this question i got my own solution from myself. so i dont mind they ignore my question or watever, as long as i happy to reless some of my recent problem here , maybe is a kind of way to reless my stress.
And i more and more like to put bracket [xxx] anything inside, so is easy for me to know where is my post .
FORUM FREEdom anyway
|
|
|
|