|
I'm using a table in the report design to display child records on a report. The data table the report table is using has many records in it, however, I only want the report table to display certain records from this data table. How can I go about doing this?
Thanks for any help on this matter.
|
|
|
|
|
hi,
have you tried using a dataview?
you can create a dataview and link that to the datatable.
set the rowfilter property of the dataview.
example<br />
dim DV as new dataview<br />
DV.table = MyTable<br />
DV.rowfilter = " field1 = 'something'"
you can assigne simple criteria to the rowfilter property.
then you can set the reports datasource to the view
MyReport.setdatasource(DV)
hence the new report source will have a filtered set of record.
U Xux
|
|
|
|
|
No I have not. I'm using the reportviewer control. My report has 2 datasources. Would adding a third one work? Also in the Init of the form with the reportviewer control I tried using the bindingsource.filter but it does not seem to work.
All I want to do on my report is list the persons name along with all of the detail records that are related to that name. Thanks for any help you can provide.
|
|
|
|
|
i am writing a webserver. i am using a winsock replacement control, that is API driven. It is called CSocketMaster , a version of the CSocket class.
any who, i need to pass a connection from the main process to a second process..
The second process starts, and in the command line i put the RequestID and i do SckMain.Accept RequestID but it dosent work because (i am assuming) its a diffrent process...
I need to know how i would accept a request from a diffrent process?
any help would be appreciated!
Visual Basic 6.0
-- modified at 13:44 Thursday 27th July, 2006
|
|
|
|
|
I have an application that will find a program based on processid.
I can then get the
Main Window Title,
Main Module Name,
Handle
BUT
I need to figure out how to then get information from that program's controls.
I am also having a hard time figuring out how to get the above information from the application's child windows. (Enum, I know, but a good starting point anyone?)
Vb.net 2003
Thanks in advance for any pointers.
|
|
|
|
|
Have you tried using remoting?
|
|
|
|
|
What is the code for connecting my windows application to sql server.
|
|
|
|
|
'set your connectionstring property of connection object.
'*************** Connection String *******************
' user id=@username;data source="@servername";initial 'catalog=@database"
'where,
'@username=your user name
'@servername=your server name
'@database= your database name
'*************** Connection String *******************
Dim conn As New SqlClient.SqlConnection("ConnectionString")
conn.Open()
!alien!
|
|
|
|
|
i want to calculate the size of all the files present in a folder how vcan i do this thank u in advance
|
|
|
|
|
Get a list of all the files, loop over each file and get its size. As you loop you accumulate the size in a variable. At the end of the loop your variable will contain the total size of all files in the directory you were looping over.
|
|
|
|
|
To simplify the steps, I have created two functions you can use.
1. The first function will get all files in specified directory. You will need to add them all up to get a total folder size.
2. The second function will convert from bytes to kilobytes.
* Note: I am not sure if you are using vb.net or asp.net. I used Vb.Net so you will see a message box in my first function
Enjoy!
'Get File sizes in directory
Public Shared Sub GetFilesSizesInDirectory(ByVal Dir As String)
'Declare a variable to recieve file name
Dim FileName As String
'Iterate through specified directory
For Each FileName In Directory.GetFiles(Dir)
'Get file info and out file size
Dim Info As FileInfo = New FileInfo(FileName)
MsgBox(FileName & " " & ToKilobytes(Info.Length) & " KB")
Next
End Sub
'Convert from bytes to kilobytes
Public Shared Function ToKilobytes(ByVal Key As Long) As Long
'Variable to recieve remainder
Dim Remainder As Long
'Result of calculation
Dim Result As Integer = Math.DivRem(Key, 1024, Remainder)
'If there is a remainder always round-up
If Remainder <> 0 Then
Result += 1
End If
Return Result
End Function
Tyquaun
-- modified at 22:53 Thursday 27th July, 2006
|
|
|
|
|
Tyquaun Hunter wrote: Note: I am not sure if you are using vb.net or asp.net
What is he's using VB.NET and ASP.NET?
VB.NET is a language. ASP.NET is a framework for writing web applications. The two are not mutually exclusive.
I think what you meant to say is: I'm not sure if you're using a Windows Forms application or a Web Forms application....
Actually, that's not really correct either, because what if it is a console application, or a windows service.... Never mind. It's Three in the Morning and it is too hot to sleep.
|
|
|
|
|
Actually, you are right. However, what I have noticed is when people say VB.net they mean winforms and asp.net, well it is assumed I am talking about ASP.net/VB.net because I am in a VB.net forum.
-- modified at 22:44 Thursday 27th July, 2006
|
|
|
|
|
i am using only Visual Basic.thank u for the solution
|
|
|
|
|
Hi,
We already have a windows service set up to write to binary file for "our" custom events. Need to translate this binary file into comma delimited text file - how would we go about doing that? Can we just some built in VS2005 functions?
any ideas/thoughts much appreciated.
Thank you for your time.
|
|
|
|
|
Se the post a few lines down entitled:
" Converting from a byte array to a string?"
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Im looking for the code to copy a complete folder with its entire contens to a target folder. I'm looking for this quite a while but i was unable to find it. Can anyone help me?
Thanks, Zaegra
--Zaegra--
|
|
|
|
|
Try this. It is a two step process.
1. Create your destination directory with the same name as your source directory.
2. Get all of the files in your source directory and copy it over to your newly created destination directory.
* Note: You should prompt the user that destination directory already exists and if it does, give them an option to overwrite it. If not, it will overwrite automatically. Also, you should prompt the user that the file exist that you are about to overwrite. I just bypass existing files. You might have to perform some other types of error handling, but fundamentally, everything you need is there.
Good Luck
Public Shared Sub CopyEntireDirectory(ByVal SourceDir As String, ByVal DestinationDir As String)
'Create Directory
Directory.CreateDirectory(DestinationDir)
'Declare a variable to recieve file name
Dim FileName As String
'Iterate through source directory
For Each FileName In Directory.GetFiles(SourceDir)
'Copy file with each iteration as long as the file does not exist
If File.Exists(DestinationDir & GetFileName(FileName)) = False Then
File.Copy(FileName, DestinationDir & GetFileName(FileName))
End If
Next
End Sub
Tyquaun
-- modified at 22:54 Thursday 27th July, 2006
|
|
|
|
|
Now hope it works, thanks!
--Zaegra--
|
|
|
|
|
Oh yes, one more question: does this copy the sub-folder in a directory to?? Should i try doing that with your code and by getting the names of each sub-folder? Thanks again, Zaegra
--Zaegra--
|
|
|
|
|
Yes. Get the name of each sub-folder and copy it over. If you are going to get nested folders(a sub-folder of a sub-folder) than it is going to get pretty complicated. Is that something you want to do?
|
|
|
|
|
Ehrm.. Im afraid so.. Because im making a program that can copy files and complete(!) folders to a target directory. But that should mean that.. i have to all names of all sub-folders in every folder? Thats going to be a lot of work, isn't there something more handy? If not, im going to try this and maybe send you the program if its ready?
Thanks Tyquan
--Zaegra--
|
|
|
|
|
Hey sorry it took so long to get back to you, but i have been busy. Here you go. This will copy directories recursively. Just replace the CopyEntireDirectory method I gave you with this:
Public Shared Sub CopyEntireDirectory(ByVal SourceDir As String, ByVal DestinationDir As String)
'Create Directory
Directory.CreateDirectory(DestinationDir)
'Declare a variable to recieve file name
Dim FileName As String
'Iterate through source directory
For Each FileName In Directory.GetFiles(SourceDir)
'Copy file with each iteration as long as the file does not exist
If File.Exists(DestinationDir & GetFileName(FileName)) = False Then
File.Copy(FileName, DestinationDir & GetFileName(FileName))
End If
Next
'Create directory recursively
Dim SubDirectory As String
For Each SubDirectory In Directory.GetDirectories(SourceDir)
If Not Directory.Exists(DestinationDir & GetFileName(SubDirectory)) Then
CopyEntireDirectory(SubDirectory, DestinationDir & "\" & GetFileName(SubDirectory) & "\")
End If
Next
End Sub
Tyquaun Hunter
|
|
|
|
|
Thanks Tyquan ! You've been a great help, thanks!
--Zaegra--
|
|
|
|