How To Convert.ToByte[] Sql Reader
Aug 26, 2010I am saving a image into database with byte[] property like this:ProfileModel:
private byte[] _imageData;
public byte[] ImageData
{
[code]...
I am saving a image into database with byte[] property like this:ProfileModel:
private byte[] _imageData;
public byte[] ImageData
{
[code]...
I have some code in my vb.net code behind that queries a database, and if there is data, outputs it from the codebehind to a datalist on my asp.net page. In addition to sending the data to the datalist on the page, I need to take the value from "mbillaty" that is returned from the sql query, and have that value be the selected value for a drop down box also on the page. I can get either the datalist to fill, or the selected value for the dropdown box to be selected depending upon which bit of code I place before the other (ARGH), but I can't get them to both work together on the page. What am I doing wrong?
[Code]....
Is it possible to integrate a fingerprint reader with asp.net? Are there any C# libraries available for detecting fingerprints?
I have no idea how to start to code the program that will store, retrieve and compare the fingerprint.
I'm looking for a way to make something very similar to this http://blog.jactionscripters.com/2009/05/23/introduction-of-qr-code-reader-library/ on my asp MVC 3 project.It is a QR Code Reader,not generator.I want it to be displayed on a View and serve as an input.Could anybody point me in the right direction to do this?
View 1 RepliesI'm looking to integrate a bunch of RSS/ATOM sources into a feed for our intranet. This is outside my usual realm of work so I've had very limited exposure to this.
I'd like to integrate all the feeds into a single reader such that all the news items are in chronological release order.
Is this doable? Do I need a special component? Or can I make the ASP.NET integrated components do all this simply enough?
I am trying to send session on Loop and trying get .
[code]....
In above code, I just only get same SessionId on every news headings, how do I get next row session id?
I have this code works perfectly in VB .NEt, not I am trying use the same code in ASP .NET and when it gets to this line, its doesn't move forward in the code to the line after
View 22 Replieshow I can loop through the results in VB, I only ever seem to get the last row, I would like to list all rows.
My code is below
[Code]....
Is there a way to access fingerprint scanner in asp.net page?
i am making a web project in which i have to verify a person by his fingerprints before adding him to database..
I have a barcode scanner . I want to read the barcode to a textbox in my asp.net application.
.So how can i get the barcode number into textbox.
I am searching for bar code integration code for Asp.net webform. Looking for complete sample source with suggestion of bar code scanner company and model name to integrate.
View 1 RepliesI'm planning for development of a RSS Provider/Reader for my website using rss toolkit,
View 13 RepliesHow to determine whether the Adobe Acrobat Reader has been installed or not on the client PC?
View 7 Repliesis it possible to find row count of a table using data reader?
View 3 RepliesI have a string coming from a stored procedure looks like '001234567'.
sqlCommand = new SqlCommand("csp_Bbp_OBN_GetBasePageList", BBConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
sqlCommand.Connection.Open();
// Run the SQL statement, and then get the returned rows to the DataReader.
accReader = sqlCommand.ExecuteReader();............
In my case, from the stored procedure I am returning the varchar, after executing and reading it I am getting the value to basePage.GrouNum which is a string. So, I don't see where it is trimming the leading zeros.
Example: GroupNumber in the table is : "001234567"
BasePage.GroupNum after reading from DataReader : "1234567"
But, I do not want the leading zeros being trimmed.
I have to provide a 508-compliant version of a page for the visually impaired and it isn't practical to just modify the page. Thus, I have created a new "reader-compatible" version of the page for the handicapped. The question is how I can tell if someone is using a reader rather than a standard browser? Is there a "header" or "useragent" value typically used by these non-standard browsers that I can look for?
View 1 RepliesI'm quite new to ASP.NET and i was wondering if someone could answer some of my questions.1. What is the difference between a DataTable and an Array? Is the DataTable a serverside control? Is it exposed to the user?2. Does the reader retrieve the column names? If so- how can I capture them? Are they the first row?2. Is it possible to populate an Array using the following sort of code, and if so- how?:
SqlCommand tableCommand = new SqlCommand();
SqlConnection tableConnection = new SqlConnection();
tableCommand.Connection = tableConnection;
[code]...
I have a web page where I want to return number of returned rows by datareader as I need to get Count of rows. My code is as follow :
SqlCommand cm = new SqlCommand(); SqlDataReader dr;sqlconnection cn; public int Returndatareader( int x)
{
int s;
string sqlstr = "SELECT COUNT(*) FROM P_Events as Counter";
cm.CommandText = sqlstr;
cm.Connection = cn;
cn.Open();
dr = cm.ExecuteReader();
if (dr.Read())
{
int y = dr.RecordsAffected;
s = y;
//return y;
}
cn.Close();
return x;
}
but the rows affected count is -1 everytime i run my code.
I'm making the leap from using all the 'wizards' that are built into VS, and have been doing more with code-behinds. But, I'm curious as to when/why I should use a reader, versus a databable, table adaptor to "manage" the data returned from a stored procedure. Typically, the data is to be displayed on a webpage, and not written back to the database. What's the difference? When should I use one over another?
View 2 RepliesOur ASP.NET application allows the users to review any number of PDF forms. A simple listbox holds filenames and the forms are displayed inside a standard iFrame. The setup is simple and effective: when the user clicks on a filename, that filename is loaded into the iFrame, and shown to the user.
Users are allowed to digitally sign the forms. For appearance purposes, a bitmap of the user' signature is generated and placed in the appropriate location of the PDF form.
The bitmap file format is GIF, and the background is transparent.
We use iTextSharp for form-filling, and we also use iTextSharp to place the bitmap on the forms. Nothing special.
We can readily verify that the signature bitmap is correctly placed on the form, and that the bitmap itself is definitely transparent.
Problem 1:
After placing the bitmap of the user' signature on the form, the form is reloaded and displayed to the user (for verification) and, in most cases, the forms do not display the bitmap. Opening the PDF reveal that the bitmap has been placed and is definitely visible in Adobe Reader (9 and 10 - these are the versions available for testing).
Experimentation and quite a bit of research seems to suggest that the problem lies in caching. One of the possible solution/suggestion is to append a time-stamp or a GUID to the URL, when loading the form after applying the bitmap. In theory, this should prevent Adobe Reader from using a cached copy of the PDF form.
We have tried appending a time-stamp and/or a GUID, without any success: the forms still display without the bitmap. At the risk of repeating myself: the PDF form is correctly signed, and the bitmap is correctly placed. It is just not visible.
This problem seems common to users running the application on intranet web servers (IIS 7). The one application instance running on public web server (IIS 7) does not seem affected by this problem.
Problem 2:
As mentioned, the GIF file generated by our application has a transparent background. In almost all cases, Adobe Reader (9 and 10) seems to understand and respect the transparency of the bitmap.
In one very peculiar case (when the application is running on a Windows 7 64 bit machine with IIS 7), when the bitmap is placed on the form, it becomes opaque (complete loss of transparency).
Again, the problem seems related to Adobe Reader, because the bitmap being applied positively sports a transparent background.
My asp.net app used Crystal report to display as pdf file.
If I open the report in my pc (newest version, Adobe reader 9), it is ok but once I open app in web server (Adobe reader 8), it display a blank screen.
Had a datareader question.
[Code].......
Return myDataReader I have a function which is retuning a datareader to various sections of my website which is then being bound to dropdown lists, gridviews, etc. Normally the last line in a function when is the data reader and connection getting closed? Is it best practive to return a data reader or a dataset/datatable (or something even better than these two)?
[Code]....
why I am not getting the desired result. I want to retrieve records in DataReader and still I am not getting any result.
I have following code that I can only add one image per row although I can add Listbox items as I wanted.
If "imgtag" 1~5 is checked, I get these in the listbox.
ie. ImageID = "cat"
listbox1. item gets - cat1, cat2, cat3, cat4, cat5
however I can only create the last image instead of 5 images.
- imageID - cat5
I assign each image unique ID.
If reader2.HasRows Then
While reader2.Read
Dim img1 = Convert.ToString(reader2("imgtag1"))
Dim img2 = Convert.ToString(reader2("imgtag2"))
Dim img3 = Convert.ToString(reader2("imgtag3"))
Dim img4 = Convert.ToString(reader2("imgtag4"))
Dim img5 = Convert.ToString(reader2("imgtag5"))
Dim blogimg = Convert.ToString(reader2("ImageID"))
Dim a As New HyperLink
a.Attributes.Add("onclick", "return hs.expand(this)")
a.Attributes.Add("href", "../../blog/images/" + blogimg)
Dim img As Image = New Image
img.ImageUrl = "~/blog/images/" + blogimg
img.Width = 200
If img1 = "1" Then
Dim blogimg1 As HtmlTableCell = CType(FindControl("blogimg1"), HtmlTableCell)
img.ID = blogimg + "1"
a.Controls.Add(img)
blogimg1.Controls.Add(a)
ListBox1.Items.Add(blogimg + "1")
End If
If img2 = "1" Then
Dim blogimg2 As HtmlTableCell = CType(FindControl("blogimg2"), HtmlTableCell)
img.ID = blogimg + "2"
a.Controls.Add(img)
blogimg2.Controls.Add(a)
ListBox1.Items.Add(blogimg + "2")
End If
If img3 = "1" Then
Dim blogimg3 As HtmlTableCell = CType(FindControl("blogimg3"), HtmlTableCell)
img.ID = blogimg + "3"
a.Controls.Add(img)
blogimg3.Controls.Add(a)
ListBox1.Items.Add(blogimg + "3")
End If
If img4 = "1" Then
Dim blogimg4 As HtmlTableCell = CType(FindControl("blogimg4"), HtmlTableCell)
img.ID = blogimg + "4"
a.Controls.Add(img)
blogimg4.Controls.Add(a)
ListBox1.Items.Add(blogimg + "4")
End If
If img5 = "1" Then
Dim blogimg5 As HtmlTableCell = CType(FindControl("blogimg5"), HtmlTableCell)
img.ID = blogimg + "5"
a.Controls.Add(img)
blogimg5.Controls.Add(a)
ListBox1.Items.Add(blogimg + "5")
End If
End While
Here is what I have tried:
txtCost.Text = string.Format("{o:c}", dr["Cost"]);
Here is the error I receive. How can I format the data that is coming from the data reader into currency format??? Also, is there a way to format it into currency without the dollar sign?
Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.