Showing posts with label accessed. Show all posts
Showing posts with label accessed. Show all posts

Tuesday, March 27, 2012

accessing image files stored as binary data

Hi

When images are uploaded and stored directly into a sql database as binary data (eg in the club starter kit) how can those images be accessed and displayed.

When I open the images table in VWD and select display data, the cells holding the image data hold a <binary data> tag. What I want to be able to do is get at that data, or actually get at the image so that it is displayed. My reason is this, at the moment the only way to access the images in the sql database after they have been uploaded is to log into the website and view them as an administrator of the site. It would be much simpler if I could access the database directly and view the contents of the images table.

Any ideas?

Thanks

If you're trying to displaying the image stored in sql server from a grid view, perhaps you should read the following post:

http://forums.asp.net/thread/1337670.aspx

Hope that helps

|||This is the same post you made here:http://forums.asp.net/thread/1337011.aspx. Please do not post the same question multiple times.

Saturday, February 25, 2012

access sql server 2000

I am new to using .net. I am told that I need to setup a config file that
will be accessed by a VB.net dll. This vb.net dll will be setup to run every
5 to 10 minutes by a timer that is coded into the vb.net application.
A user will submit a request to obtain data from a HP mainframe.
This web config file needs to be able to do the following:
1. The user will submit the request to a sql server 2000 database (that
resides on a different that where the vb.net application will be running).
2.. The vb.net code will that submit the request for data to the hp
mainframe by using http and xml.
Thus my questions are:
1. How do you setup a connection and retrieve data from the sql server 2000
database that resides with the company's intranet? This will somehow need to
include a connection object and statements oh how to connect to the SQL
server 2000 database. The user name and password are suppose to be passed to
the sql server as part of the connection string.
2. How would I request to the HP mainframe using soap, http, and xml to wrap
up the request?
Thanks!Regarding the SQL Server part of your question, you can use System.Data
SqlConnection and SqlCommand objects to connect to SQL Server and execute
queries. The results can then be retrieved using a SqlDataAdapter
(disconnected) or SqlDataReader (connected).
The example below shows how you can accomplish the task using a
parameteritized SELECT statement. You can find details and many examples in
the Visual Studio reference.
Try
'Create connection
Dim conn As New SqlConnection( _
"Data Source=MyServer;Integrated Security=SSPI;Initial
Catalog=MyDatabase")
'Create command
Dim cmd As New SqlCommand( _
"SELECT MyData FROM MyTable WHERE MyKey = @.MyKey", conn)
cmd.CommandType = CommandType.Text
'Create input paramater for command
cmd.Parameters.Add("@.MyKey", SqlDbType.Int)
cmd.Parameters("@.MyKey").Direction = ParameterDirection.Input
cmd.Parameters("@.MyKey").Value = 1
cmd.Connection.Open()
Dim da As New SqlDataAdapter(cmd)
Dim dt As New DataTable
da.Fill(dt)
'process dt DataTable here
conn.Close()
Catch ex As SqlExcelption
'exception handling here
End Try
Hope this helps.
Dan Guzman
SQL Server MVP
"Wendy Elizabeth" <WendyElizabeth@.discussions.microsoft.com> wrote in
message news:1693FA1F-8530-4F22-B4D8-EBA89881C8B5@.microsoft.com...
>I am new to using .net. I am told that I need to setup a config file that
> will be accessed by a VB.net dll. This vb.net dll will be setup to run
> every
> 5 to 10 minutes by a timer that is coded into the vb.net application.
> A user will submit a request to obtain data from a HP mainframe.
> This web config file needs to be able to do the following:
> 1. The user will submit the request to a sql server 2000 database (that
> resides on a different that where the vb.net application will be running).
> 2.. The vb.net code will that submit the request for data to the hp
> mainframe by using http and xml.
> Thus my questions are:
> 1. How do you setup a connection and retrieve data from the sql server
> 2000
> database that resides with the company's intranet? This will somehow need
> to
> include a connection object and statements oh how to connect to the SQL
> server 2000 database. The user name and password are suppose to be passed
> to
> the sql server as part of the connection string.
> 2. How would I request to the HP mainframe using soap, http, and xml to
> wrap
> up the request?
> Thanks!

Access rights...

Hello,
I want to restrict the database not to be accessed from anywhere except my webservice...I mean, my client applications or anyone else can not be able to access the database...
How can I do this?
Thanks very much...

Are you looking for something similar to what was discussed in the following thread?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=52094&SiteID=1

If not, can you explain what exactly you are trying to protect?

Thanks
Laurentiu