DataSource Controls :: Retrieving SQL Filestream Data With Visual Studio SQLDataSource?
Jun 4, 2010
Is there anything special you have to do to retrieve Filestream data using a SqlDataSource? I'm using VB and have this as my sqldatasource:
<asp:SqlDataSource ID="SqlDataSourceReadPD" runat="server" etc...
SelectCommand="SELECT [PDIPAttachment] FROM [PositionDescriptions] WHERE ([CP_IDString] = @CP_IDString)">
<SelectParameters>
<asp:Parameter Name="CP_IDString" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
PDIPAttachment is a FILESTREAM column in my table called PositionDescriptions
and this is some of my VB cod:
Dim dv As DataView = DirectCast(SqlDataSourceReadPD.Select(DataSourceSelectArguments.Empty), DataView)
Dim dr As DataRowView
For Each dr In dv
Dim data as Byte() = System.Text.Encoding.ASCII.GetBytes(dr("PDIPAttachment").ToString())
Next
The Filestream data has a PDF file in it, but what I"m getting back in "data" are 13 bytes consisting of: "System.Byte[]".
View 2 Replies
Similar Messages:
May 19, 2010
how can i set the parameter source of an SqlDataSource to a variable from visual studio?
View 2 Replies
Feb 28, 2010
I'm using Visual Studio 2008 SP1 for ASP.NET 3.5 development.But the SqlDataSource control is not visble in the Toolbox - Data section.When I drag in a GridView control, the smart task list asks me to configure the SqlDataSource control, so it is "in there somewhere"
View 2 Replies
Jun 4, 2010
I'm trying to define a sqldatasource for writing out SQL Filestream data. For example, I have a SQL table with a column named Data, which is FileStream. The column type is VarBinary(max)
InsertCommand = "INSERT INTO MYTABLE (Data) VALUES (@Data)"
<asp:Parameter Name="Data" Type = ???? What goes here????>
In the code-behind to load the data, I want something like,
e.Command.Parameters("@Data").Value = StringToByteArray("HERE'S THE CONTENTS OF MY FILE")
I have StringToByteArray defined as Encoding.Unicode.GetBytes(String.Empty+inputParameter)
View 2 Replies
Dec 19, 2010
I have created a asp.net webpage for viewing daily downloaded newspaper, saved as a pdf file in a selected folder (~/NEWS/{0}) within the web root directory. Also i have a SQL datasource linked, where the news table has two columns viz: date and filename.
I want to create a tiled listview where the date text is visible on the hyperlink. on clicking the hyperlink, the file name is retreived for the corresponding date and the pdf file opens in a fresh page.
I have tried going to the item template in listview and replacing the label control with a hyperlink control, but then not able to successfully proceed ahead.
View 6 Replies
Oct 7, 2010
In visual studio 2005 for windows application , there is option where you can add New datasource by going to menu Data>Add New Data source, I know you can connect to database by using Dim con as connection, Dim cmd as command, Dim da as ataadapter, then query database and get result
View 1 Replies
Jun 1, 2010
I have a vb.net application which I'm trying to run in VS 2008. The application builds successfully, however, when I try to debug the windows application it throws the following error, "Retrieving the COM class factory for component with CLSID {794D671E-F0F0-11D2-BEB0-009027438003} failed due to the following error: 80040154." I've been searching for a solution for a few days now with no luck. I've tried to register the referenced DLLs (w/regasm command), messed around with the configuration manager, etc. Also, please note that the application ran successfully in Windows XP, but it no longer seems to work since I've upgraded my OS to Windows 7 (I've tried to run the application in x64 and x84 platforms w/no luck). Also, I'm referencing the following DLLs:
INTEROP.ASPEMAILIB.DLLINTEROP.SCRIPTING.DLLINTEROPS.MSXML2.DLL
Is it possible that some of these DLLs aren't supported in Windows 7?
View 3 Replies
Apr 7, 2010
How do I specify a port number for a Data Connection in the Server Explorer of Visual Studio 2008. It would use 1433 as a default but the administrators changed it for security purposes.
View 2 Replies
Jul 11, 2010
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. make sure the user has a local user profile on the computer. The connection will be closed.
View 1 Replies
Feb 25, 2010
I have been founding an effiecent way to retreive values returned by LINQ 2 SQL stored procdure on my presentaion layer. Am using following method rightnow:-
public List<String> MthInvitesBA()
{
List<String> lst = new List<string> { "" };
ISingleResult<USP_Actor_View_InvitesDetails1Result> invites = obj.USP_Actor_View_InvitesDetails1(p_UserName);
foreach (USP_Actor_View_InvitesDetails1Result c in invites)
{
lst = new List<string> { c.Invites_Used.ToString(), c.NoOfDoc.ToString(), c.Request_For_More_Invites.ToString() };
return lst;
}
return lst;
}
It works but at the cost of my performence due boxing unboxing on BA layer as well as on design layer. Now, I have one method which returns me 100 columns from table So in this way i have convert 100 coulmns value into type string then On design layer again have to type caste some values .Moreover, i could only access this list using index which is of type integer, which is very diffcult and tedious task to debug d code. i could effiecenlt retreive these values. Is it possible using IEnumerable? How to access Ienuemerable in design layer?
View 1 Replies
Jul 2, 2010
When I drag and drop an SQLDataSource control to my new web page it disappears after I set it up.
It exists in Source but I can't see it in Design. I'm doing the same thing I would do in VS 2005 and I can see the control in design view.
Why can't I see the control? I'm new to VS 2008 and .Net 3.5.
View 2 Replies
Jul 6, 2010
I am facing below error
"Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005."
"at WebApplication1._Default.GenerateExcel(String xmlString) in E:\TestWebApp\WebApplication1\WebApplication1\Default.aspx.cs:line 110
at WebApplication1._Default.Page_Load(Object sender, EventArgs e) in E:\TestWebApp\WebApplication1\WebApplication1\Default.aspx.cs:line 30
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"
View 1 Replies
Feb 25, 2010
i have two sqldatasource controls. one i use to display data in textbox's ,filter'd by a select parameter in page behind code. Once checked, i want to copy this data to the other datasource ,by selecting checkbox.Then display this data in detailsview control.
At present the two datasource controls declared , render data to the page simultaneously during pageload. I want to first check data in textbox's from first source, before second datasource is rendered to screen. note, both are filtered by a page variable. i wish to leave the textbox datasource control in situ, as other controls and code depend on it.The other detailsview datasource is my problem?
View 1 Replies
May 14, 2010
I am trying to tie a sqlDatasource to a Stored Procedure. The stored procedure looks like...
[Code]........
View 2 Replies
May 27, 2010
In of my application I am using the database to store and retrive images. The table stores the documents and the datatype of the field is IMage.
Now with Sql Server 2008, i would like to upgrade this to use this new feature. WHat changes do I have to make in terms of code and also in the database.
View 5 Replies
Jan 25, 2010
I've got a vb.net page that when a user clicks a button in a gridview, it copys the file (row seleted) in the gridview as "Label2" from the webserver to the users pc. (We had to setup a lot of security to get it so the webserver could copy to the users pc). I have that all working fine, but now, I'm trying to see if FileStream will then open the file that was just downloaded on the users PC. I'm not familiar with FileStream, and could use a little push in the right direction. (Disclaimer, yes I know downloading the file directly to the pc is a crazy thing to do, but it's a really long story. :-)
For the FileStream portion, I found this sample, but don't quite understand if I can incorporate it into my button click event. Here's the sample [URL]
[Code]....
[Code]....
[Code]....
View 3 Replies
Mar 17, 2010
I try to use one Calendar, i have example with XML, but i wont to read from SQL,
[Code]....
View 2 Replies
Feb 24, 2010
I'm new to asp.net, php had this function that could store sql date in an array, I can't find something similar in .net, so this is what I came up with so far.
Sub Compareid()
Dim queryString As String = "Select top 2 id from my_videos order by id desc"
using connection As New SqlConnection(ConfigurationSettings.AppSettings("sqlacct")
[code]...
View 6 Replies
May 25, 2010
I been trying to get my Visual Studio 2008 to run my Web Application on IIS7 on my Windows 7 machine but I just can't get it to work. I'm using the SQLEXPRESS I been following this Tutorial, but I get the following error message.
"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. make sure the user has a local user profile on the computer. The connection will be closed."
my connectionString seem to be ok
[Code]....
The site run with out database connection.
View 3 Replies
Jun 28, 2010
Can VS 2010 connect to a SQL 2000 database?
I get this error while using the Data/Connect and SQL Server 2008 R2 comes up.
"The connection failed because this instance of SQL Server is not supported. The Editor cannot connect to SQL Server 2000 or earlier versions."
Our production server is on SQL 2000
View 7 Replies
Aug 17, 2010
I have hard time trying to find the solution to retrieve data from multiple tables in one database.
table Kategorije has fields: idKategorija, naziv, opis table Clanak has fields: idClanak, idKategorija, naslov, autor,...
Kategorije.idKategorijais joined with Clanak.idKategorija, but that isn't the solution because I want my web site to show the Kategorije.naziv instead of Kategorije.idKategorija. This is the code I'm currently using to get idKategorije shown on my web site:
[Code]....
[Code]....
View 3 Replies
Feb 6, 2010
but i have a problem to retrieve value from the database in the textbox using 3-tier application. ]
in the App_data i have following folder.
1> employeeBAL in this i have 1class file called empbasicinfoBLL.cs
2> employeeDAL in this i have test_data.xsd
in the basic details folder i have one page Basic information(employee basic info) in this i want that when user will log in the site [using username and password] after successful login when user will click on the Basic information then he will able to see his [name, employee no, first name, last name] etc on the page [i don't want to use grid-view to retrieve the details becoz i am using the table in this i am using Lable and Textbox for each] and this data should come from the EmployeeBAL.
View 1 Replies
Jul 28, 2010
I'm currently working on a FOREX Live Trading project that I'm implementing.
I already have a database that stores the CURRENCY PAIR, BUY/SELL, PRICE AND QTY.
But I have a huge problem.
Scenario that is:
A person BUYS EUR/USD at a PRICE of 1.29900 @ quantity 100,000. (This will be recorded in the database table)
Then he BUYS EUR/USD at a PRICE of 1.29950 @ quantity 100,000. (This will then be recorded in the database also)
Then he decides to SELL his EUR/USD at a PRICE of 1.31000 @ quantity 200,000 all out. (How can I check from the database if he previously had make a transaction of BUY/SELL, so that I can do my necessary calculations for the P/L Statement)
View 3 Replies
Jan 16, 2010
Which version of Visual Studio 2008 do you currently use with NHibernate? I would like to test out NHibernate at home, but I'm not sure if I want to shell out $500 plus for VS 2008 professional edition. Has anyone had any luck with NHibernate on VS 2008 standard or even one of the VS express editions?
View 4 Replies
Mar 31, 2010
I want to retreive some data from an SqlDataSource using it's Selected event I've tried
DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty)
but here it's going into in infinite loop and then it gives me an StackOverflowException error in ASP.Net Development Server (my dev machine) and if I publish to IIS it requires me an user name and password to connect to server and gives an InternetExplorer error "Sys.WebForms.PageRequestManagerServerErrorException. An unknown error ... status code returned was 400. The SqlDataSource is in an UpdatePanel. Maybe this is why I get this.
View 1 Replies