|
Hii All
How can i count the dulplicate values stored in the particular column of the table in database, through windows application.
For e.g. If incase i want to display no. of books with same title from the title column in the text box.
In the window form named multiple books which has a datagrid connected to the book entry database should display only the records which are multiple. And as datagrid row is clicked the information of no. of books available should be displayed in the textbox on same form.
Suppose there are five books on Title (Gone with the winds) the datagrid will display the book details in one row as one book. And as user clicks the particular row the textbox1.text should display the no. 5 .
Please try to solute
Thanks
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
hi
try to excute this query :
SELECT Count(*) AS boos_count, book_title
FROM books_table
GROUP BY books_table.book_title
Tamimi - Code
|
|
|
|
|
<b>Hai!
I struck up badly in displaying group header even though dont have records in detal section (Using Crystal Reports 8.5).
Actually, I've a ProductId Group header in which i'm showing opening balances.
In detail section I'm showing the detail records of that productid which is in group header.
It's working when I've detail recrods to show. But its not showing the even the group header which contains opening balances when there is no records in detail section to show.
pls pls pls give any suggetion or recmondations
thanking you lt;/b>
M. YASEEN
Software Engineer
MN Textiles
Karachi
|
|
|
|
|
Hi,
Use This query in The Add Command Instead of adding Tables
SELECT *
FROM PdMaster Left Outer JOIN
Pdetails ON PdMaster.PId = Pdetails.Pid
Thanks and Regards
Anu
|
|
|
|
|
Hi,
i want to merge 2 cells in excel when i am Exporting data from datagrid to cells. how can i do that .please send me a reply.
i am using code like this to export data
Dim XlApp As Excel.Application
Dim XlBk As Excel.Workbook
Dim XlSht As Excel.Worksheet
Dim r As Excel.Range
XlApp = CreateObject("Excel.Application")
XlBk = XlApp.Workbooks.Add
XlSht = XlBk.Worksheets(1)
XlApp.Visible = True
XlApp.Cells(1, 2).Font.Name = "Arial"
XlApp.Cells(1,2).Font.Bold = True
XlApp.Cells(1, 2).Font.Size = 9
XlApp.Cells(1, 2).value = "Mode Of Shipment"
r = XlApp.Cells(1, 2)
r.ColumnWidth = "Mode Of Shipment".ToString.Length * 1.5
XlApp.Cells(2, 2).Font.Name = "Arial"
XlApp.Cells(2, 2).Font.Bold = False
XlApp.Cells(2, 2).Font.Size = 9
XlApp.Cells(2, 2).value = DtGenReport.Rows(0)("Item").
if the heading is large i want to merge 2 cells.
Thanks and Rgards
Anu
|
|
|
|
|
Hello,
I am using a datepicker control VS 2005.
I have looked at the properties and cannot find any thing that allows me to display this in UK format. The default seems to be US. Is there any way to change the format so that is displays the date in UK format.
Thanks in advance,
Steve
|
|
|
|
|
It will use the locale set on the thread.
|
|
|
|
|
Have you tried using the CustomFormat property? Also, set the Format property to "Custom"
|
|
|
|
|
hi,
Everyone know how to convert this vb6 code
" ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net??
Please help!
charleslau2855
|
|
|
|
|
ListView1.Items(i+1) is how you access the item. I assume it has a SubItems property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If you want to add an item to a listview...
If i understand your question right
'Single Entry at the end of the list
<code>Dim _ListViewItem AS ListviewItem = New ListViewItem(New String() {Column1Data, Column2Data, ...ColumnXData}, -1)
_ListView.Items.Add(ListViewItem)</code>
'Multible Entry
<code>Dim _ListViewItems(X) as ListViewItem
Dim _ListViewItem AS ListviewItem</code>
' The loading loop
<code>_ListViewItem = New ListViewItem(New String() {Column1Data, Column2Data, ...ColumnXData}, -1)
_ListViewItems(_ListViewItems.Lengt-1) = ListViewItem </code>
'Loop ends
<code>_ListView.Items.AddRange(ListViewItems</code>)
This is A easy why to add items to a listview...
VB6 =
|
|
|
|
|
I don't think you can add SubItems by index.
However, you can retrieve SubItems by index.
You will probably need to use an array to insert the value at the appropriate index and then rebuild the ListView using your array.
Steve
|
|
|
|
|
Hello.
Can anybody tell me how to create a virtual network interface with the .Net Framework and VB.NET?
Do I have to write a driver in general or is the .net framework able to do this?
thx,
Martin.
|
|
|
|
|
There is a sample driver called NetVMini in the XP DDK.
|
|
|
|
|
You'll have to write a device driver to do this. This is a task not suited to VB.NET or C#. Managed code can be run in Kernel mode, but all the Interop required to do this will slow down the driver considerably. Not to mention you'll be injecting the full weight of the .NET Runtime, about 20 MB worth, into Kernel space. Yuk! Examples and support will be VERY sparse.
Your best language to do something like this is VC++...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'd suggest that you post this to the collaboration forum, and if you have areas you'd like to improve, ask specific questions about them here as well.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm getting a file from a listbox that is fileinfo. I'm going to do some reading and writing based on the data in the selected file. I can only find examples of streamreader that use file name as a string. How do I convert the fileinfo to string?
Thanks
silver-gray
|
|
|
|
|
Every .NET class has a tostring method.
What do you mean by FileInfo ? Surely there's a sring there, what's the listbox showing ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You should look into the FileInfo.OpenRead and FileInfo.OpenWrite methods. This will return a FileStream that you can use in the constructor of a StreamReader.
Example
Imports System.IO
Dim fi As FileInfo
'get object from list box
Using fs As FileStream = fi.OpenRead()
'use fi.OpenWrite() for a writeable stream
Using sr As New StreamReader(fs)
'read or write here
End Using
End Using
|
|
|
|
|
Try it out.
It will read a file and will put the contents of file into a string.
Dim reader As StreamReader = File.OpenText("c:\myfile.txt")
Dim line As String = reader.ReadToEnd
Manish
|
|
|
|
|
Try it out.
This code will read a file and will put file's contents into a string
Dim reader As StreamReader = File.OpenText("c:\myfile.txt")
Dim line As String = reader.ReadToEnd
Manish
|
|
|
|
|
I'm writting VBA macro code with array start index as 1 rather 0
Option Base 1
Dim array() As String
If()Then
ReDim array(5)
'fill array with elements
Else
ReDim array(0) 'This statement gives error
End If
I try to use UBound() and LBound() to determine if the array is empty, but can't make it work.
Someone please tell me if there is other way to make it work.
|
|
|
|
|
You can't ReDim an array down to 0 when the Option Base is 1. The lowest you can ReDim down to, obviously, is 1.
I don't know what you mean by "if the array is empty". It appears as though you're trying to ReDim a variable that was an array to no longer be an array. You can't do that. Once a variable is declared, you cannot change it's type. If it's declared as an Integer or Long, it has to stay an Integer or Long. You can't ReDim it to make it an array of Longs. The opposite is also true. Once delcared as an array, it must stay as an array. You can't ReDim it down to a single-valued variable.
I think the function you're looking for is
IsArray(var). This will return True or False depending on if the var is an array or not.<br />
<br />
<br />
<div class="ForumSig"><font color="Blue">Dave Kreskowiak<br />
Microsoft MVP - Visual Basic</font><br />
</div>
|
|
|
|
|
Hi, Dave,
I declared an array, then under certain conditions, this array will be filled with elements, otherwise it will stay empty.
After get through the condition statements, I need to determine if the array is empty.
I tried to use UBound() and LBound(), but I receive compile error on it when the array is not ReDim and filled with elements. what is the best way to determine if the array is empty?
Thanks
Vicky
|
|
|
|
|
"Empty" can be different things. If the variable is not declared an array, or if the variable is declared an array but has no elements, and it can be declared an array and have empty elements.
It depends on the call that's creating the array. You just have to test it to find out.
IsArray will tell you if the variable is declared as an array, but that's it. If that test passes, then you can check its UBound. If it's greater than 0, the array has elements. After that, you check the value of the first element to see if that value is valid.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|