VS 2008 Datatable Not Display Actual Size Of Data?
Feb 3, 2011
my .net app output data from sql server to a datatable in my app using executreader.for example:one of the column size in sql server varchar(40),actullay the field only contain 2 chars (like: "AB" for example)when it executes into datatable,it display in the column like "AB" <<this chars + white space = actual size of the column,but I want only the size of the data only, which is "AB" when I export it as csv file the field is >> "AB?
View 4 Replies
ADVERTISEMENT
Apr 21, 2010
Is there a way to determine how many bytes of data are in a DataTable after I've filled it with data from my query?
View 13 Replies
May 14, 2010
I'm using the following to populate a listbox from a sql server:[code]Is Available returns true (It's a bit in sql) or false - Is it possible to replace this with something shorter, say a checkbox or tick image?Also, is it possible to only display actual data rather than the whole field including empty characters? I have a few nchar(30) fields, the above seems to include all 30 character spaces.
View 4 Replies
Nov 17, 2011
I have the following barcode image:
I'm using the following iTextSharp VB.NET script to generate a PDF document containing this barcode:
Dim pdfDocument As iTextSharp.text.Document = Nothing
Dim filename As String = HttpContext.Current.Server.MapPath("barcode.pdf")
pdfDocument = New iTextSharp.text.Document()
[Code]....
When this PDF is generated, however, the image is appearing larger than expected, and is distorted:
I can't see anywhere where I'm setting the image to be a specific size, so why would it distort like this? And how can I prevent it?
It's crucial that this image remains the size it is intended to be so that it can be read by barcode scanners.
View 1 Replies
Oct 6, 2010
I am trying to solve an issue in my application where the following exception is occurring: there is already an open datareader associated with this command which must be closed first. I am using TableAdapters, which maintain their own DataReaders, and everything seems to work fine unless I am interacting with one of my background workers.
In my code, I shadow the Item property of my collections so that I can retrieve the actual data from the database if needed. Here is a sample:
[code]...
Now each reference to the Item get property instantiates its own DataAdapter, so I am confused as to how the same DataReader will ever be used in this scenario. Is there something I am missing? All the TableAdapters do in fact use the same connection object, but I wouldn't think that would be a problem
View 4 Replies
Feb 21, 2009
It seems that the autosize columns will only make them bigger. For example, if I have a DGV that fills most of the form and then only three small columns are loaded, there is a whole bunch of darkgrey empty space. Is there any way to snap the side of the DGV to the actual data?
View 8 Replies
Apr 4, 2011
on my Bookings program i've got a listbox where i can select the booking date of each room, and then i can see the details "UserID, time start time end etc". When the UserID is read from the database it takes the user id number (which its supposed to) but now i want to take that number, and match it to the actual "User Name" and then display the Name.this is what i've got so far;
Dim BookingDetails As New SqlCommand("SELECT UserID,......(and the rest)
then i execute the reader
Dim drBookingDetails As SqlDataReader = BookingDetails.ExecuteReader
and then i'd want to convert the read data, into the actual user name?
View 3 Replies
Nov 21, 2009
When I move or copy files, I'd like to know how to show the actual progress of the data transfer.Something that I don't understand is how when moving or copying files to detect the actual progress of the data transfer. I always put the moving/copying in a background worker and that does fine, but presently I can only report status based on how many (of the total) files have been moved or copied.I've tried to look at the destination and my thinking was to report the progress based on the bytes there, but that doesn't work because it always sees it as being the complete file's size, even though that makes no sense.In fact, if you copy a file using Windows Explorer, it does the same thing, although obviously it's still transferring.
View 5 Replies
Oct 4, 2010
I am creating a data logger that pulls data from an existing OPC server. When the data logger is launched, I look into the OPC server and get the names of the sensors that need logging (ColumnNames() as string) . From that, I am creating a data table with columns based on the items in ColumnNames(). That part is working. What I am having problems with is adding rows to the table. When I read the values from the OPC server, I get an array of strings (values() as string) which is guaranteed to be in the same order as the ColumnNames.I have been trying to use an SqlDataAdapter with a dynamically built insert command, but it is getting extremely convoluted and ugly.Is there an way to add a data row to my table using an array of string values directly?
View 5 Replies
Nov 17, 2009
I have a little big problem in one application.
I have a datagridview with data from a datatable, this datatable have these fields (id,num1,num2, date,user,ref,qt,cost,center), some of them are hided in the dgv (id,num1,num2,date,user). The user can edit,delete and add new rows to the dgv.
I have a save button that performs this actions:
First check if there are new rows, and if yes it fill the hidden fields. Then validate the inserted values by the user with a couple of ifs. In the end, i call the bindingsource EndEdit, and call the adapter Update command against the datatable...
This sometimes works others not really, i don't understand why.
The error it's: "Concurrency violation: the DeleteCommand affected 0 of the expected 1 records"
I think sometimes when Updating it occurs to.
View 11 Replies
Dec 19, 2009
The next step is I need to build a randomizer to randomly select a row and read the columns of that row into varibles.I have a working randomizer that can randomly pick a number between min and max values but what I don't know if how to select a row / How to find out how many rows are available and how to read the values into varibles.Am I right in declaring an Integer Varible then using:
AvailableRows = DDT.Rows.Count
Then use my Random Function to pick a number between 0 and AvailableRows
View 8 Replies
May 7, 2010
I load up a datatable - bind it to a binding source and a binding navigator - and lots of textboxes on the screen bound to that as well.When I get a concurrency violation - another user has already changed my vendor, let's say - what is the best method to go about refreshing the datatable with current data from the DB?
View 10 Replies
Apr 4, 2011
I've a xml file to load into the datatable, but no data is loaded, also without any error. the output is 0.[code]
View 2 Replies
Sep 29, 2011
I have a Business Logic Layer that contains function that return datatables. I'm writing a function that will return just the records that begin with the string passed in. this is what I've come up with so far:
Public Function FetchBusinessAreas(ByVal area As String) As List(Of BusinessArea)
Dim AreasList As New List(Of BusinessArea)
Dim dt As DataTable
[code].....
View 2 Replies
Jun 2, 2010
i'm got this sql query code in dataset designer
SELECT pkt.fldPackageID, pkt.fldPSID, pkt.fldQuantity, pkt.fldQuantityUsed, pkt.fldRetail, pkt.fldPK, ps.fldName
FROM tblPaketRow AS pkt INNER JOIN
tblProdukDanService AS ps ON ps.fldID = pkt.fldPSID
WHERE (pkt.fldPSID = @param)
I'm trying to display the results in datagridview,i drag from the data source in vs 2008..I can't figure out to do that.I use this code to set the @param on form_load event.
Me.TblPaketRowTableAdapter.JoinTable(SalonDataSet.tblPaketRow, modCommon.s)
View 10 Replies
Jan 25, 2010
I'm trying to do a LINQ Query against a typed datatable that will return me duplicated data.With out going into too much detail, here's the basic setup:
strCode1 - string type
intCode1 - int32 type
intAdjustor - int32
There are more fields but these are the ones that are important.I'm going to do my best to describe this, as it's kind of confusing.In theory intCode1 is a key for strCode1 (hence the names). So each time intCode1 is duplicated, the same strCode1 should appear. Example:
[code]...
Ultimately I'd like to get a List(Of T) - where T is my typed data row. In SQL, I would simply use a sub query, to get a distinct list of strCode1 and intCode1, then do a count, grouped by strCode1 where I get more than one row.I'm not sure how to translate that into LINQ, AND get the original types data rows returned in a list.
View 7 Replies
Oct 31, 2010
how to copy data from datatable to table in dataset i ry this but its readonly property
ds.datatable1=newdt.copy
View 1 Replies
Aug 10, 2011
I am updating a data table (dt_report_crypt) from an encrypted csv file in the code below:I decrypt the colums and update the same dreport_crypt, such that it will contain de-crypted data.This part is working wellI however need to use this de-crypted datatable as a data source to update a second table(dt_report), using the sql SELECT command to filter relevant data,
Dim dt_report As DataTable
Dim dt_report_crypt As DataTable
Using cn As
[code].....
View 6 Replies
Nov 20, 2009
Im trying to resize a picturebox dynamically using .size.height and .size.width Its not working. This is the error message: "Expression is a value and therefore cannot be the target of an assignment." Never used height and width before. Been trying to find the answer, but it seems beyond me. Im sure its easy. Anyone know whats wrong with this?
[Code]...
View 3 Replies
May 4, 2009
I'm using the 2008 express edition. Now, I created an application that will allow the user to choose transaction in the combobox.text and input its price and quantity using an textbox.text. When the user click button1, it will be push in the datagrid/datable I created. And when the user click the button2, it must be save to excel file. The only thing I need is how to save the data from datagrid/datatable to excel. This is my code.
Imports System.Data
Imports System.Data.SqlClient
Imports Excel = Microsoft.Office.Interop.Excel
[Code]....
View 1 Replies
Jul 31, 2009
When a project has been published the file that is put in my start menu is an application reference. How do i get hold of the actual executable file so i can post a demo?
View 3 Replies
Jul 13, 2010
I have wondered the solution to this question for many years! I doubt if anyone else knows much about it because the internet is absolutely zero help in this!
I have made a form1 with a webbrowser control on it. When the program is run it brings up the homepage (which is Google). However the homepage doesn't seem to fit inside the webbrowser control.
So I am hoping that someone could tell me how to make the (...I dunno how to ask this retarded question...) webpage fit completely (100%) inside the size of the webbrowser control. Meaning...I would like to see the entire webpage from the internet in the
size of the webbrowser control. To fill the entire size (whatever size I want).
Etc... if my webbrowser ontrol is seh, set to 600px by 400px, how can I program this so when it brings up the homepage (or any other page), it fills the entire size of the webbrowser control? Without any scrollbars. How to make the contents from the web
(or local) fill the size of the webbrowser - almost like a mini browser if you will.
View 4 Replies
Feb 3, 2012
I have a vb.net form to add, modify or delete the product list..i have a datagridview in which i m loading data from sql server datatable...now i have a text box which accepts code for the product..i want that when i press a key, all data starting with that key should be highlighted in datagridview.....
eg
i have product codes
A001
A002
A003
C001
D001,, etc..
Now i press A in text box...in datagridview all data with A should be highlighted
View 7 Replies
Mar 5, 2010
I developed a form application on my computer, but when it was used in another computer with different screen size, i was told the form didn't fit. Do I have to adjust the form size or any other ways to let the form compatible on different screen size? (could be different screen size or wide screen)
View 2 Replies
Aug 22, 2011
So that's how I want it:
If I re-size the form, the textbox inside should be re-sized to fit the form, NOT DOCK!
View 5 Replies
Jan 17, 2009
I need to use the BindingNavigator to cycle thru the records of one of the tables in an Access database. The table has 5 text fields and 3 image fields. On a form I have placed 5 TextBoxes and 3 PictureBoxes. I included a BindingSource control and BindingNavigator control and configured them. This automatically generated the TableAdapter, BindingSource and Dataset. I then manually bound each TextBox and PictureBox using the DataBindings area in each of their Properties. I can run the program and display the records, but only the Text fields show anything. The images are not displayed in the PictureBoxes.
View 8 Replies
Jan 19, 2010
Table gpass has data as
gate-----date-----c----bno----acccode----tittle----weight-------qty
1----18/01/2010---a----2--------2----------abc-----10.00-------15
Then there are two textbox having values as
txtgat.text=1
txtdat.text=18/01/2010
I these codes and it generates error message as ArgumentOutOfRangeException was unhandled.Idex was out of range. Must be non-negative and less than the size of collection. Parameter name: Index
Private Sub txtGat_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtGat.TextChanged
If Len(Me.txtGat.Text) > 0 AndAlso Me.txtDat.Text IsNot Nothing Then
str = "Select * from gpass where vou_no= " & Val(Me.txtGat.Text) & " And Date = '" & Me.txtDat.Text & "'"
dt = GetTable(str)
[code].....
View 5 Replies
Aug 9, 2009
I'm curious what we all are using to display grids of data.I keep falling back to LISTVIEW's in DETAIL mode - they visually look nice to me. But I'm always writing code to load them from datatables and such - lots of work.DATAGRIDVIEW's - not so nice looking. Of course we can edit them easily - and they bind really easily
View 2 Replies
Dec 18, 2009
I have a datatable similar in structure the first attached image where each * represents some data
Ultimately I want a new table in the form of the second attached image.
Currently, I have opened a connection to my access database and pulled in the data for case 102 into a datatable and case 103 into a separate datatable. [code]...
Then I loop through each row in Dt1 to check if item1 in Dt1 exists in Dt2. If it exists, I determine which row it's at and add in the data for item2 and item3 into Dt2.
View 4 Replies
Apr 20, 2010
I am now to asp.net.
i would like to add 01 in to datarow and then add to datatable.
however only 1 shows in datatable and zero is missing.
View 1 Replies