To Retrieve Image Data From A Table

Jul 25, 2001

Hi,
Can any one help me to retrieve an image data from a table.
I wanted to show the images on my web page using ASP.
I am trying with pub_info table of pubs database, in this table logo is a image data type colum. I opened a record set in ASP page and I am not able to retrieve the image from the record set.

Any help is appreciated!

Ravi.

View 2 Replies


ADVERTISEMENT

HOW To Retrieve An Image From Sql Server And Display It In ASP.net Using Imagemap Or Image ?

Jul 6, 2006

Ok, the problem is that , i have a field called "Attach" in sql of type image, when selecting it , the field is getting data of type BYTE(). which am being unable to display them on an Image on the panel.

using the following vb.net code:

'Dim sel2 As String

'Dim myCom As SqlCommand

'Dim conn As New SqlConnection

'Dim drr As SqlDataReader

'Dim image As System.Drawing.Image

'sel2 = "select * from attach where att_desc = '" & DropDownList1.SelectedItem().Text & "' and doc_code = " & w_doc_code & " and subcode = " & w_doc_subcode & " and doc_num= " & w_doc_num & " "

'conn.ConnectionString = ("server=developer01;uid=sa;password=aims;database=DVPSOC;timeout=45")

'myCom = New SqlCommand(sel2, conn)

'conn.Open()

'drr = myCom.ExecuteReader()

'If drr.Read Then

' Me.ImageMap1.ImageUrl = drr.Item("attach")

'End If

'conn.Close()

Am getting an exeption on the following line Me.ImageMap1.ImageUrl = drr.Item("attach")

saying: Conversion from type 'Byte()' to type 'String' is not valid.

knowing that i tried converting using ToString but it's not getting any output then.

thanks for your help.

View 4 Replies View Related

Retrieve Image From SqlServer

Nov 7, 2006

hi all
i hav a database with some images...images r stored in binary data form
i want to retrieve that image from database and display it in a details View
im inserting images to database like this
public void OnUpload(Object sender, EventArgs e)
{
int len = Upload.PostedFile.ContentLength;
byte[] pic = new byte[len];
Upload.PostedFile.InputStream.Read (pic, 0, len);
SqlConnection connection = new SqlConnection ("integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbAsoftWeb;Data Source=ASP");
try
{
connection.Open ();
SqlCommand cmd = new SqlCommand("insert into tblStock " + "(Image, Image_Data,[DESC],PRICE,BAL_QTY,PV) values (@pic, @text, @lblProd, @lblPrice, @lblPV, @lblQty) ", connection);
cmd.Parameters.Add("@pic", pic);
cmd.Parameters.Add("@text", Comment.Text);
cmd.Parameters.Add("@lblProd", txtProdName.Text);
cmd.Parameters.Add("@lblPrice", txtPrice.Text);
cmd.Parameters.Add("@lblPV", txtPV.Text);
cmd.Parameters.Add("@lblQty", txtQty.Text);
cmd.ExecuteNonQuery ();
}
finally
{
connection.Close ();
}
im able to get the image in to form but i want to display it in a detailsview
how cani do it..can any one explain me
thanks in advance
Hari

View 1 Replies View Related

Retrieve Database Image By 2 Ids

Feb 28, 2008

Hi, I'm stuck trying to figure out how to call an image from the database by certain ids.  I want to get it like this: page.aspx?pictureid=#&userid=#
here's the show.aspx:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim PictureID As Integer = Convert.ToInt32(Request.QueryString("ppID"))Dim MemberID As Integer = Convert.ToInt32(Request.QueryString("mID"))
'Connect to the database and bring back the image contents & MIME type for the specified pictureUsing myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("objConn").ConnectionString)
Const SQL As String = "SELECT [ppMIMEType], [ppImageData] FROM [tblPP] WHERE ([ppID] = @ppID) & ("[mID] = @mID)"Dim myCommand As New SqlCommand(SQL, myConnection)
myCommand.Parameters.AddWithValue("@ppID", PictureID)
myCommand.Parameters.AddWithValue("@mID", MemberID)
myConnection.Open()Dim myReader As SqlDataReader = myCommand.ExecuteReader
If myReader.Read ThenResponse.ContentType = myReader("ppMIMEType").ToString()
Response.BinaryWrite(myReader("ppImageData"))
End If
myReader.Close()
myConnection.Close()
End Using
End Sub
 here's the formview to display image with datasource:
<asp:FormView ID="PictureUI" runat="server" DataKeyNames="ppID,mID" DataSourceID="PicturesDataSource" AllowPaging="False" EmptyDataText="There are currently no pictures uploaded" HorizontalAlign="Center" CellPadding="0">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ppID", "~/Show.aspx?ppID=" & 1 &"mID=" & 1 &"") %>' />
 
</ItemTemplate>
 
</asp:FormView>
 
<asp:SqlDataSource ID="PicturesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Connect %>"
SelectCommand="SELECT [ppID], [ppDateTime], [mID] FROM [tblPP] ORDER BY [ppDateTime]">
</asp:SqlDataSource>

View 3 Replies View Related

Retrieve An Image, For Display On Website?

Feb 25, 2006

How would I do if I want to make a query that returns an image, which in turn should be displayed on a webpage?

View 2 Replies View Related

How Do I Retrieve SQLCE Bitmap Image

May 4, 2007

Hello,

I have not seen a response to this specific question so here goes. I had working code for loading an image into my smart device SQLCE db and for retrieving images. But after upgrading my application to SQLCE 2.0 I am unable to use my retrieve code. This is what was previously working,



Dim ImageBytes As Byte = rs.GetValue(rs.GetOrdinal("OLE"))

Dim ImageStream As New System.IO.MemoryStream(ImageBytes)

frmFlashcardActive.picboxBlobToPicBox.Image = New Bitmap(ImageStream)



Help!



This is what I successfully use to save the image to the database



Dim PictureInfo As New FileInfo("My DocumentsUSAFlag.bmp") 'OpenDialog.FileName

Dim PictureSize(PictureInfo.Length) As Byte

If PictureSize.GetValue(0) <= 69 Then

Dim fsPicture As New FileStream(PictureInfo.FullName, FileMode.Open)

Dim PictureReader As New BinaryReader(fsPicture)

PictureReader.Read(PictureSize, 0, PictureSize.Length)

'find the previous record and add the picture

rs.SetValue(rs.GetOrdinal("OLE"), PictureSize) 'could be FlashcardAPic

rs.SetValue(rs.GetOrdinal("Picture"), "True")

rs.Update()

fsPicture.Close()

View 1 Replies View Related

How To Load Image To And Retrieve From Database(sql Server)

Feb 19, 2005

can anyone out there help me to solve this problem???

how to load image to and retrieve from database(sql server)??
thanks alot

cyndie

View 3 Replies View Related

How To Retrieve Image Stored In SQL Server From My VB Project

Nov 29, 2001

Hi anyone can help me? i would like to retrieve an image stored in my SQL server from my VB project using ADO... anyone familiarise in it? pls help me... i need it urgently..... tks...

View 1 Replies View Related

How Can I Retrieve Data From One Table To Another

Jan 12, 2006

Hi, everione,

I am having a big problem, trying to create datebase.
I have 3 tables: SUPERAVATAR, MASTERAVATAR, MEGAAVATAR.
- SuperAvatars are heroes in an online role playing gaming. They have an ID, ‘superavatarID’ which contain an UNIQUE NUMBER NOT NULL PRIMARY KEY to identify them.
A wisdom – ‘trickster’,’conjuror’,’magician’, etc..
A current owner… who is the user or player of the game and has that Super Avatar– we associate the link to USERID to know the person.
SuperAvatars can be fathers or mothers of Mega Avatars.
-MegaAvatars are the children of SuperAvatars…. They also have an ID UNIQUE NUMBER NOT NULL PRIMARY KEY to indentify them.
A magic power – it can be a ‘Leader’ or ‘Sheep’…
A ‘parent’ – parent is the number identifying to know to who Super Avatar belongs.
e.g.
SUPERAVAT WISD CURRENTOWNER FATHEROF MOTHEROF
1 Thick 3 1
2 Mentally Ch. 11 3
3 Smart 9 2
4 Genius 16 4
5 Thick 19



MEGAAVATARID MAGICPOWER PARENT
1 MAGICIAN 1
2 WIZARD 3
3 SORCERER 2
4 MAGICIAN 4

-We see that MEGAAVATAR 1 has a magic power as Magician and his father is ‘1’. ‘1’ identifies the SUPERAVATAR.
We see SUPERAVATARID…. who has the number ‘1’? the first in the row… who has wisdom – thick and he belongs to the USER with ID number 3.
-We see MEGAAVATARID… we choose the number 2…. His magic power is as WIZARD… and his father is the number 3.
We see SUPERAVATARID now… we look up the SuperavatarID 3…. We can see he has a wisdom – GENIUS… who belongs to the USERID 16 and he is father of MEGAAVATAR number 2.
The list can carry on and never stop.

I have this Problems:
We create in this example 3 tables: Users, SuperAvatar, MegaAvatar

SQL
CREATE TABLE users(userID NUMBER CONSTRAINT pk_user PRIMARY KEY,email VARCHAR2(50) NOT NULL UNIQUE,password VARCHAR2(15) NOT NULL UNIQUE,subscription CHAR(8) NOT NULL CHECK (subscription IN('ACTIVE' , 'INACTIVE' ) ) );

CREATE TABLE superavatar(superavatarID NUMBER CONSTRAINT pk_superavatar PRIMARY KEY, wisdom VARCHAR2(19) NOT NULL CHECK (wisdom IN ('THICK', 'MENTALLY CHALLENGED', 'AWAKE', 'SMART', 'GENIUS')), currentOwner NUMBER NOT NULL, fatherOf NUMBER,motherOf NUMBER);

CREATE TABLE megaavatar (megaavatarID NUMBER CONSTRAINT pk_megaavatar PRIMARY KEY, magicPower VARCHAR2(12) NOT NULL CHECK (magicPower IN('TRICKSTER','CONJUROR','MAGICIAN','WIZARD','SORCERER')), parent NUMBER);

Now, the 3 tables are created…..
What happen when we try to insert values to this table?
In this case we insert to User Table some examples:
INSERT INTO users VALUES('3','john@hotmail.com','great78','ACTIVE');
INSERT INTO users VALUES('9','chrisandsandra@gmail.com','chrisandra)','ACTIVE');
Now, we insert to SuperAvatar some examples;
INSERT INTO superavatar VALUES('1','THICK','3','1','');
INSERT INTO superavatar VALUES('3','SMART','9','3','');
|
|
‘9’ is the UserID that we already insert to the User table
What’s the problem?
We have to insert manually the data from USERID to CURRENTOWNER as we didn’t match or link CURRENTOWNER from SUPERAVATAR Table to USERID from USER Table with a SQL CODE.
What happen if we have thousands of USERS that they register to this game…? We will never know to how belongs that SUPERAVATAR but if someone do it manually can spend a year.

I am trying to fix this problem …. I add in SUPERAVATAR TABLE ‘CHECK’ in currentOwner..

SQL> CREATE TABLE superavatar
(superavatarID NUMBER CONSTRAINT pk_superavatar PRIMARY KEY, wisdom VARCHAR2(19) NOT NULL CHECK (wisdom IN ('THICK', 'MENTALLY CHALLENGED', 'AWAKE', 'SMART', 'GENIUS')),
currentOwner NUMBER NOT NULL CHECK (currentOwner IN(SELECT userID FROM users)),
fatherOf NUMBER,
motherOf NUMBER);
*
ERROR:
ORA-02251: subquery not allowed here

It doesn’t work.

Please HELP, I have exam tomorrow

thank you
Desy

View 1 Replies View Related

Retrieve Data From Another Table In Subquery

Apr 11, 2004

Hi there, here is my current query:

sqlTemp = "SELECT id,code,description FROM tbl_content " &_
"WHERE EXISTS " &_
"(SELECT * FROM tbl_published_content " &_
"WHERE tbl_content.id = tbl_published_content.id ORDER BY tbl_published_content.nCorrectOrder)"


I don't get results sorted by tbl_published_content.nCorrectOrder, and have also no iea how to retrieve that values.

Please can any one tell me how can I have access to tbl_published_content.nCorrectOrder and get it sorted by this field?

So I can use objRS.("tbl_published_content.nCorrectOrder") or some alias?

thanks a million!

View 2 Replies View Related

Retrieve Data Into 3 Column Table

Feb 3, 2014

What would be the most efficient method of constructing a sql statement to retrieve certain record into (this gets tricky) rows of a table with 3 columns date.desc.

<table>
@foreach(var row in maytable){
<tr>
<td>@row.Most_Recent_Record1</td>
<td>@row.Most_Recent_Record2</</td>
<td>@row.Most_Recent_Record3</</td>
</tr>
}
</table>

View 1 Replies View Related

How To Retrieve Data From A Second Table With No Foreign Key

Oct 5, 2007



I have 4 tables I am pulling data from. Table A and B can be joined and Table C and D can be joined via foreign keys but A and/or B can not be Joined to C and/or D via foreign Key.

My statement basically looks like this to start


SELECT s.HTENANT, s.HPROP, s.HUNIT, s.SHEADNAME3B, s.DTOT7I
FROM H8summ S join tenant t on s.htenant = t.hmyperson

And returns this :


29226 128 20577 Almukhtar, Khadijah M 4242.00
26574 128 17980 Archie, Mary 20218.00

The last number is the key it is the income.

In another table we have an income limit table setup that would have the low, medium and high settings for the range.

For instance it may have 11400 as the elimit attribute and say 22000 as the vlimit attribute.

Then in the fourth table we the description that can be linked back to the income limit table via the hinclimit attribute. In this case the desc attribute would be ELI for elimit and VLI for vlimit.

So I want to take the income compare it to the income limit table and then return the description

The output would look like this :
29226 128 20577 Almukhtar, Khadijah M 4242.00 eli
26574 128 17980 Archie, Mary 20218.00 vli

I just not sure how to reference the income limit table without the foreign key in the from statement. When I just add it it returns 6 rows for each person (number of rows on the income limit table)




View 1 Replies View Related

Retrieve Data From Table Type Variable

Dec 5, 2014

Can we retrieve data from table type variable as an array in oracle key values..

E.g.

ALTER PROCEDURE prn1( @p_prn as KeyValuePair readonly)
-- proc which having parameter table type as parameter
AS
declare @v_formatted_str varchar(50)
BEGIN
set @v_formatted_str = v_formatted_str + @p_prn(1)(1)
END

View 3 Replies View Related

Copy Image Data Type From One Table To Another

Sep 22, 2004

Hi,
I've a column col1 of image data type in table1. I would like to copy the data from col1 to another image column col2 in table2. Before moving the value, checking has to be done to specify which col1 data from table1 is needed and the destination has to be checked too.

Example: insert into col2
(select col1 from table1 where table1_id =5)
where table2_id =6

Hence bcp wouldn't work. Can anyone suggest me a way to do it. I tried using writetext but then, i've to get data from col1 in a variable, which is not possible. Any suggestions would be very helpful.

Thanks in advance.
Ramya.

View 1 Replies View Related

Taking Time For Retrieve Data From Temperary Table

Feb 11, 2008

View 1 Replies View Related

Insert Information And To Database And Retrieve The ID Created For That Row Of Data In The Table

May 4, 2007

Hi,
 I am working on inserting information into a DB and then retrieving the ID created for that Data to use elsewhere in my code. I have the code below but I do not know how to get toOutput parameter. Can anyone please help?
  
CREATE PROCEDURE dbo.InsertProduction
@DATEOUT datetime(8),
@DATEREQUIRED datetime(8),
@PREPAREDBY varchar,
@COMMENTID INteger,
@TOTALQUANTITY INteger,
@VENDORID INteger,
@WPO varchar,
@TCAPONUMBER INteger,
@APPROVEDBY varchar,
@Identity int OUT
 
AS
INSERT INTO PRODUCTION (DATEOUT,DATEREQUIRED, PREPAREDBY, COMMENTID, TOTALQUANTITY, VENDORID, WPO, TCAPONUMBER, APPROVEDBY) VALUES( @DATEOUT, @DATEREQUIRED, @PREPAREDBY, @COMMENTID, @TOTALQUANTITY, @VENDORID, @WPO, @TCAPONUMBER, @APPROVEDBY)
SET @Identity = SCOPE_IDENTITY()
 
 
'collect all the information from the form and then apply all and then update
'Get a reference to the Production table.
Dim dtProduction As DataTable = DS.Tables("Production")
Dim dtLineItem As DataTable = DS.Tables("LineItems")
' Create the SqlCommand to execute the stored procedure.
Production.InsertCommand = New SqlCommand("dbo.InsertProduction", connection)
Production.InsertCommand.CommandType = CommandType.StoredProcedure
' Add the parameter for the CategoryName. Specifying the
' ParameterDirection for an input parameter is not required.
'Production.InsertCommand.Parameters.Add("@CategoryName", SqlDbType.NVarChar, 15, "CategoryName")
Production.InsertCommand.Parameters.Add("@DATEOUT", SqlDbType.DateTime, 8, "CategoryName")
Production.InsertCommand.Parameters.Add("@DATEREQUIRED", SqlDbType.DateTime, 8, "CategoryName")
Production.InsertCommand.Parameters.Add("@PREPAREDBY", SqlDbType.VarChar, 50, "CategoryName")
Production.InsertCommand.Parameters.Add("@COMMENTID", SqlDbType.Int, 4, "CategoryName")
Production.InsertCommand.Parameters.Add("@TOTALQUANTITY", SqlDbType.Int, 4, "CategoryName")
Production.InsertCommand.Parameters.Add("@VENDORID", SqlDbType.Int, 4, "CategoryName")
Production.InsertCommand.Parameters.Add("@WPO", SqlDbType.VarChar, 50, "CategoryName")
Production.InsertCommand.Parameters.Add("@TCAPONUMBER", SqlDbType.Int, 4, "CategoryName")
Production.InsertCommand.Parameters.Add("@APPROVEDBY", SqlDbType.VarChar, 50, "CategoryName")
' Add the SqlParameter to retrieve the new identity value.
' Specify the ParameterDirection as Output.
Dim parameter As SqlParameter = Production.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 0, "ProductionID")
parameter.Direction = ParameterDirection.Output
' Create a new row with the same schema.
Dim dr As DataRow = dtProduction.NewRow()
'you need the ID from this to insert into the Production DB
' Set the value of all the columns.
dr("DateOut") = CDate(DateTimePicker1.Text)
dr("DateRequired") = CDate(DateTimePicker2.Text)
dr("VendorID") = CInt(vendorbox.SelectedValue)
dr("HomeAddress") = txtApproved.Text.ToString
dr("ApprovedBy") = txtPrepared.Text.ToString
dr("TCAPO") = CInt(txtTCAPO.Text.Trim)
dr("CommentID") = CommentID
dr("TotalCost") = CDec(txtTotals.Text)
dr("TotalQuantity") = CInt(txtQtyTotal.Text)
' Add to the Rows collection or table .
dtProduction.Rows.Add(dr)
'Update the Production Table and then retrieve the ID created in this case
Production.Update(dtProduction)
 
 
Dollarjunkie

View 2 Replies View Related

How To Get And Use A Plausible Subquery To Retrieve Data Of Some Columnns Of Dbo.Table And Put Them In A New DboTable?

Jan 31, 2008

Hi all,

I have 2 Tables "dbo.Samples" and "dbo.TestResults" listed below:
dbo.Samples:
SampleID SampleName Matrix SampleType ChemGroup ProjectID




1
Blueriver01
Water
Primary
VOCs
1

2
Blueriver02
Water
Duplicate
VOCs
1

3
Blueriver03
Water
QA
VOCs
2

4
Blueriver11
Soil
Primary
VOCs
1

5
Blueriver12
Soil
Duplicate
VOCs
1

6
Blueriver13
Soil
QA
VOCs
3
where SampleID is Primary key in this table.


dbo.TestResults:
AnalyteID AnalyteName Result Unit SampleID



1
Acetone
120.800
ug/L
1

2
Benzene
25.600
ug/L
1

3
Trichloroethene
13.000
ug/L
1

4
Xylenes
0.000
ug/L
1

5
Acetone
90.700
ug/L
2

6
Benzene
31.400
ug/L
2

7
Trichloroethene
19.200
ug/L
2

8
Xylenes
2.000
ug/L
2

9
Acetone
140.300
ug/L
3

10
Benzene
21.500
ug/L
3

11
Trichloroethene
22.200
ug/L
3

12
Xylenes
0.000
ug/L
3

13
Acetone
222.100
ug/Kg
4

14
Benzene
10.300
ug/Kg
4

15
Trichloroethene
30.200
ug/Kg
4

16
Xylenes
50.700
ug/Kg
4

17
Acetone
211.900
ug/Kg
5

18
Benzene
16.400
ug/Kg
5

19
Trichloroethene
34.700
ug/Kg
5

20
Xylenes
60.000
ug/Kg
5

21
Acetone
220.300
ug/Kg
6

22
Benzene
13.200
ug/Kg
6

23
Trichloroethene
32.000
ug/Kg
6

24
Xylenes
55.500
ug/Kg
6

NULL
NULL
NULL
NULL
NULL

where AnalyteID is Primary key and SampleID is Foreign key in this table.

Note: The relationship between "dbo.Samples" and "dbo.TestResults" has been established.


============================================
I want to get a new T-SQL output "dbo.Report" like:

SampleID SampleName Unit Acetone Benzene Trichloroethene Xylenes
1 Blueriver01 ug/L 120.800 25.600 13.000 0.000
2 Blueriver02 ug/L 90.700 31.400 19.200 2.000
3 Blueriver03 ug/L 140.300 21.500 22.200 0.000
4 Blueriver11 ug/Kg 222.100 10.300 30.200 50.700
5 Blueriver12 ug/Kg 211.900 16.400 32.000 60.000
6 Blueriver13 ug/Kg 220.300 13.200 32.000 55.500

I want to get the first 2 columnns from the "dbo.Samples" table and the 3rd, 4th, 5th, 6th, and 7th columnns from the "dbo.TestResults" table. I think I can create a new "dbo.Report" table with the 7 Columnn Names, and retrieve the data of SampleID and SampleName from the "dbo.Samples" table and put them into the "dbo.Report" table. But I do not know how to retrieve the data of Unit, Acetone, Benzene, Trichloroethene, and Xylenes from the "dbo.TestResults" table and put them into the "dob.Report" table formatted and presented in the above blue-colored table. The following is my T-SQL programming plan:
-- Create a new table called "Report"
CREATE TABLE Report
(
SampleID int,
SampleName nvarchar(25),
Unit nvarchar(25),
Acetone decimal(9,3),
Benzene decimal(9,3),
Trichloroethene(9,3),
Xylenes decimal(9,3),
);

-- Insert the data of SampleID and SampleName from dbo.Samples --
SELECT SampleID, SampleName
FROM dbo.Samples

-- Insert the data of Unit, Acetone, Benzene, Trichloroethene, and Xylenes from dbo.TestResults --
I guess I may be able to use the following code:
INSERT INTO dbo.Reort(Unit, Acetone, Benzene, Trichloroethene, Xylenes)
SELECT x????
FROM y????
WHERE z????
(SELECT xxx??
FROM yyy??
WHILE zzz='##??")
GO

I do not know how I can get and use the above planned "subquery" correctly to get the data I want!!?? Please help and give me a delaied instructions or direction to achieve this task.

Thanks in advance,
Scott Chang

View 16 Replies View Related

Sending Uploaded Image To Data Access Class When Storing Image In SQL Server 2005

Apr 20, 2007

I am using the 3-tiered architecture design (presentation, business laws, and data acess layers). I am stuck on how to send the image the user selects in the upload file control to the BLL and then to the DAL because the DAL does all the inserts into the database. I would like to be able to check the file type in the BLL to make sure the file being uploaded is indeed a picture. Is there a way I can send the location of the file to the BLL, check the filetype, then upload the file and have the DAL insert the image into the database? I have seen examples where people use streams to upload the file directly from their presentation layer, but I would like to keep everything seperated in the three classes if possible. I also wasn't sure what variable type the image would be in the function in the BLL that receive the image from the PL. If there are any examples or tips anyone can give me that would be appreciated.

View 2 Replies View Related

Retrieve And Display Image Inside An Html File (stored In Database) In Binary Format

May 15, 2007

Hi All,
I am not sure whether this is the right place to post this question. But I am unable to figure out what is the best solution to retrieve and display an image in a html file(stored in varbinary(max) column). I have a list of images in the file and I am supposed to display them. Can anybody please let me know what is the best way to do this?
Thanks a lot!!

View 1 Replies View Related

Data Access :: How To Retrieve Remote Database Table Value To String Variable

May 28, 2015

I am using C# in  Visual Studio 2008 and remote database as sql server 2008 R2. I want to read remote database table's field value and i have to move that read value to string variable. how to do it. 

And my code is :

string sql = "Select fldinput from tmessage_temp where fldTo=IDENT_CURRENT('tmessage_temp')";
SqlCommand exesql = new SqlCommand(sql, cn);
exesql.CommandType = CommandType.Text;
SqlDataReader rd1 = default(SqlDataReader);
rd1 = exesql.ExecuteReader();

View 6 Replies View Related

Retrieve Data From Properties Field In Prifile Table In Aspnetdb.mdf For Multi Users ?

Mar 12, 2008

I want retrieve data from properties field in prifile table in aspnetdb.mdf for multi users,what do i ?

View 1 Replies View Related

Transact SQL :: Retrieve Currently Created Date From Master Table To Load Into Parent And Child Table

May 12, 2015

In Master tabel i have these date datas

2015-05-10

2015-05-11

2015-05-12

SO when i try to load from  Master table to parent and child table i am using using expresssion like 

select B.ID,A.* FROM FLATFILE_INVENTORY AS A JOIN DMS_INVENTORY AS B ON 
A.ACDealerID=B.DMSDEALERID AND A.StockNumber=B.STOCKNUMBER AND 
A.InventoryDate=B.INVENTORYDATE AND A.VehicleVIN=B.VEHICLEVIN
WHERE convert(date,A.[FtpDate]) = convert(date,GETDATE())  and convert(date,B.Ftpdate) = convert(date,getdate()) ;

If i use this Expression i am getting the current system date data's only  from Master table to parent and child tables.

My Problem is If i do this in my local sserver using the above Expression if i loaded today date and if need to load yesterday date i can change my system date to yesterday date and i can run this Expression.so that yeserday date data alone will get loaded from Master to parent and  child tables.

If i run this expression to remote server  i cannot change the system date in server.

while using this Expression for current date its loads perfectly but when i try to load yesterday data it takes current date date only not the yesterday date data.

What is the Expression on which ever  date i am trying load in  the master table  same date need to loaded in Parent and child table without changing the system Date.

View 10 Replies View Related

What's The Accepted Way To Retrieve Records In A SQL Table With Null Values Using A Visual Studio 2005 Table Adapter?

Jan 21, 2008

I'm using an ObjectDataSource in Visual Studio to retrieve records from a SQL Server 2005 database.
 I have a very simple dilemma.  In a table I have fields FirstName, Surname, Address1, Address2, Address3 etc. None of these are mandatory fields.
It is quite common for the user not to enter data in Address2, Address3, so the values are <null> in the SQL table.
In Visual Studio 2005 I have an aspx form where users can pass search parameters to the ObjectDataSource and the results are returned according to the passed in parameters.
The WHERE clause in my Table Adapter is:WHERE (Address1 LIKE @Address1 + '%') AND (Address2 LIKE @Address2 + '%') AND   (Address3 LIKE @Address3 + '%') AND (FirstName LIKE @FirstName + '%') AND (Surname LIKE @Surname + '%')
If, for example, I simply want to search WHERE FirstName LIKE ‘R’, this does not return any results if the value of Address3 is <null>
My query is this: Could someone please show me the best way in Visual Studio 2005 to return records even if one of the Address fields is <null>.
For reference, I have tried: Address3 LIKE @Address3 + '%' OR IS NULLThis does work, however itsimply returns every instance where Address3 is <null>  (accounting for about 95% of the records in the database). Thanks in advance Simon
 

View 9 Replies View Related

Error Inserting Image Into SQL Server2000 Table From Pocket PC Application Only When Using Stored Procedure In Table Adapter Wiz

Apr 24, 2008

My Pocket PC application exports signature as an image. Everything is fine when choose Use SQL statements in TableAdapter Configuration Wizard.


main.ds.MailsSignature.Clear();

main.ds.MailsSignature.AcceptChanges();


string[] signFiles = Directory.GetFiles(Settings.signDirectory);


foreach (string signFile in signFiles)

{


mailsSignatureRow = main.ds.MailsSignature.NewMailsSignatureRow();

mailsSignatureRow.Singnature = GetImageBytes(signFile); //return byte[] array of the image.

main.ds.MailsSignature.Rows.Add(mailsSignatureRow);

}


mailsSignatureTableAdapter.Update(main.ds.MailsSignature);

But now I am getting error "General Network Error. Check your network documentation" after specifying Use existing stored procedure in TableAdpater Configuration Wizard.


ALTER PROCEDURE dbo.Insert_MailSignature( @Singnature image )

AS

SET NOCOUNT OFF;

INSERT INTO MailsSignature (Singnature) VALUES (@Singnature);



SELECT Id, Singnature FROM MailsSignature WHERE (Id = SCOPE_IDENTITY())

For testing I created a desktop application and found that the same Code, same(Use existing stored procedure in TableAdpater Configuration Wizard) and same stored procedure is working fine in inserting image into the table.

Is there any limitation in CF?

Regards,
Professor Corrie.

View 3 Replies View Related

Asp.net Page Is Unable To Retrieve The Right Data Calling The Store Procedure From The Dataset/data Adapter

Apr 11, 2007

I'm trying to figure this out
 I have a store procedure that return the userId if a user exists in my table, return 0 otherwise
------------------------------------------------------------------------
 Create Procedure spUpdatePasswordByUserId
@userName varchar(20),
@password varchar(20)
AS
Begin
Declare @userId int
Select @userId = (Select userId from userInfo Where userName = @userName and password = @password)
if (@userId > 0)
return @userId
else
return 0
------------------------------------------------------------------
I create a function called UpdatePasswordByUserId in my dataset with the above stored procedure that returns a scalar value. When I preview the data from the table adapter in my dataset, it spits out the right value.
But when I call this UpdatepasswordByUserId from an asp.net page, it returns null/blank/0
 passport.UserInfoTableAdapters oUserInfo = new UserInfoTableAdapters();
Response.Write("userId: " + oUserInfo.UpdatePasswordByUserId(txtUserName.text, txtPassword.text) );
 Do you guys have any idea why?
 
 

View 6 Replies View Related

How?retrieve Data From Table1 Then Save The Retrive Data To Table2...

May 8, 2008

Good day., please help me,in a formview control, i set it in Insert Mode, so it should display info from table 1 but when i click on the insert button, it will insert it in table 2.btw, table 1 and table 2 are in the same database?? how about if they are not in the same database?how?please help me,Thanks.,SALAMAT PO., 

View 3 Replies View Related

Retrieve Text File Data In SSE For Data Acquisition System

Oct 24, 2007

Hey All,
I am developing a data acquistion system which monitors the amount of energy that a user consumes in different parts of a house and displays the information in real time on their computer screen. I am collecting the data through tranducers attached to the circuit breakers in the breaker box and sending the data to analog-to-digital converter channels in a MCU. I am retrieving the data from the serial port and storing it to a text file. Each line of data in the text file represents three fields which are separated by commas. I will be reading data from multiple data collection boxes so the first field is the unit number, the second fied represents the analog-to-digital converter channel number from each unit, and the third field is the data that is collected from the ATD channel. I am trying to use SSE to retrieve the data from the text file, and parse each line of data into individual columns in a databse. Then I want to be able to extract the data associated with a particular ATD channel number from the databse and display it in the appropriate text field on a windows form.
I've got the MCU programmed. I have no problem collecting the data from the serial port, and I can do the visual basic programming okay. I have absolutely no clue how to read the data into the database, continuosly read new values into the databse, and then access the stored data to update the text fields on the form. Please help if you can, I've been working on this specific problem for a couple of weeks and I'm not making any progress. Thanks.

View 3 Replies View Related

How To Convert To Regular Text, Data Stored In Image Data Type Field ????

Jul 20, 2005

Hi,This is driving me nuts, I have a table that stores notes regarding anoperation in an IMAGE data type field in MS SQL Server 2000.I can read and write no problem using Access using the StrConv function andI can Update the field correctly in T-SQL using:DECLARE @ptrval varbinary(16)SELECT @ptrval = TEXTPTR(BITS_data)FROM mytable_BINARY WHERE ID = 'RB215'WRITETEXT OPERATION_BINARY.BITS @ptrval 'My notes for this operation'However, I just can not seem to be able to convert back to text theinformation once it is stored using T-SQL.My selects keep returning bin data.How to do this! Thanks for your help.SD

View 1 Replies View Related

Retrieve Text File Data In SSE For Data Acquisitio

Oct 24, 2007

Hey All,
I am developing a data acquistion system which monitors the amount of energy that a user consumes in different parts of a house and displays the information in real time on their computer screen. I am collecting the data through tranducers attached to the circuit breakers in the breaker box and sending the data to analog-to-digital converter channels in a MCU. I am retrieving the data from the serial port and storing it to a text file. Each line of data in the text file represents three fields which are separated by commas. I will be reading data from multiple data collection boxes so the first field is the unit number, the second fied represents the analog-to-digital converter channel number from each unit, and the third field is the data that is collected from the ATD channel. I am trying to use SSE to retrieve the data from the text file, and parse each line of data into individual columns in a databse. Then I want to be able to extract the data associated with a particular ATD channel number from the databse and display it in the appropriate text field on a windows form.
I've got the MCU programmed. I have no problem collecting the data from the serial port, and I can do the visual basic programming okay. I have absolutely no clue how to read the data into the database, continuosly read new values into the databse, and then access the stored data to update the text fields on the form. Please help if you can, I've been working on this specific problem for a couple of weeks and I'm not making any progress. Thanks.

View 1 Replies View Related

Move Text Data (not A File) Into An Image Data Type

Mar 11, 2008



The ERP manufacturer used an image data type to store large text data fields. I am trying to move these data types from one database to another database using either Sql Queries or MS Access. I can cast them as an 8000 char varchar to read them directly but have no luck importing into these image data fields.

Access and Crystal are not able to read these fields directly.

Any suggestions? Most information about these fields has to do with loading files but I am just moving data.

Thanks,

Ray

View 1 Replies View Related

How To I Retrieve The First Value From A Table In T-SQL?

May 21, 2006

I want to do something similar to ExecuteScalar in ADO.net but instead in T-SQL.Basically I want to do a query that will return the first value in the table queried and put it into a variable.  How do I do this?Thanks in advance.

View 3 Replies View Related

Retrieve Second Max Value In A Sql Table

Feb 25, 2004

Hi all,
I want to retrieve the second maximum value of a column data present in SQL table.Please help....

A
----
10
25
23
15


here I want 23 as the result.

View 5 Replies View Related

Retrieve Value From A Table With The Value From So

Apr 11, 2008

I am trying t get output for the following querry but I know am missing something. Can anyone help me out with it.


select distinct productnum, (SELECT SUM(quantity) FROM orderlineitem w WHERE w.productnum = e.productnum) as Quantity
from orderlineitem e where parentOrderlineitemid is null order by Quantity desc)

In the above query am getting the productnum and quanity and it looks like this

productnum quantity
abc 6
ttt 3
sss 1

What am tring to do to this query is that . From another table 'product' i want all the data to be retrieved with this productnum(the table 'product' has a column called prductnum). I don't know how to write a query for this.

my query is
select * from product where productnum in (
select distinct productnum, (SELECT SUM(quantity) FROM orderlineitem w WHERE w.productnum = e.productnum) as Quantity
from orderlineitem e where parentOrderlineitemid is null order by Quantity desc)

Thanks.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved