|
I added another variation to this code that works very nicely to provide a search based on part of the "Keywords" field. Add this to the btnLoad_Click sub:
tbSearch.Text = "%" & tbSearch.Text & "%"
Again, Thanks to Kevin for the assist! Got the creative juices flowing again, lol.
LWhite
|
|
|
|
|
I am trying to copy a file from a web folder
("http://server/folder/file.ext") to a regular folder from my com+ component.
I was using an ADODB.Record with the msdaipp oledb provider. This works fine
in a desktop application but when I moved the code to my component - it
turns out this provider (because it uses wininet) cannot be used in a middle
tier or server side application. I am getting the error message "cannot find
the provider ...". The regular desktop app works fine on the same machine.
Do I have any other alternative? What other technique can I use to copy a file located on a web folder using my Com+ component and VB?
Thanks!
|
|
|
|
|
I am having a problem with accessing a web service and am hoping that someone out there can help me out...
I am working on a VB windows forms application that will access a web service running on a Windows 2003 server. As I am starting a new project, I decided that it's a good time to move from Visual Studio 2003 to Visual Studio 2005. My problem is that with VS2005 I can not access the web service and with VS2003 I can. Additionally, if I turn of my web proxy (Control Panel, Internet Options, Connections, LAN Settings) the web service works fine with VS2005. Unfortunately, turning off the proxy server is not an option. The error I get running VS2005 with the proxy server is "The request failed with HTTP status 403: Forbidden."
This is a sample of the code I'm working with:
Dim FAMISService As New FAMIS6.ImportEntity
Dim dtFAMISLocations As DataTable
FAMISService.PreAuthenticate = True
FAMISService.Credentials = System.Net.CredentialCache.DefaultCredentials
FAMISService.Proxy = System.Net.WebRequest.DefaultWebProxy
FAMISService.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials
dtFAMISLocations = FAMISService.GetLocations().Tables(0)
I've tried it with and without the service proxy settings with no effect. Any thoughts or suggestions would be appreciated.
Regards,
TJS
|
|
|
|
|
After visual studio application is created, I copied all the files to another machine because I want to run it on another machine.
1. Does the local machine need to have SQL server installed in order to run the application?
2. Since Visual Studio application uses the SQL server path for connectionstring of development machine, How can I change the path on local machine to run the application?
3. Do I need to copy SQL Server database to local machine?
Any help would be appriciated.
Thank you in advance.
programmer
|
|
|
|
|
There should be no need to install SQL Server on the machine that the application is going to be run from. If you built the connection string on the development machine by dragging a connection from the server explorer into the development area, this string should work on any machine. This assumes that you aren't using windows authentication to connect to the server. (If thats the case make sure the user using the app has correct authentication to SQL Server on the data server). IF all that was done and the users machine is in the same network architecture as your development machine. It should work without problem.
-- modified at 13:33 Wednesday 15th November, 2006
|
|
|
|
|
I am a student in a colege, one of my projects involes making a program and learning about Visual Studio.
Getting Straight To the Point, I have looked on the internet at various dlls for zipping and compressing with a password ect, but i can't find a website that tells me how to include the dlls so that i can use them.
it would be greatley apreicated if someone could give me example code of a program that zips a file and unzips a file....
Most of the ones i have found have been For Vb6.
I can't seem to use this code, and don't know enough to convert it.
Please only answer with Visual Basic Code...... 2005 Edition
Thanks For Any Help, i have spent two days googling and now i think my head will explode.....thanks for any help.
Learning, For The Next Generation.......
|
|
|
|
|
have you looked at gzipstream ? it can do what you want...
|
|
|
|
|
Can this be? Does the getFiles method alter the LastaccessedDate? If so does anyone know a way around this problem. I am developing a program that just cannot have its files data altered in any way.
Any help fro you all would be greatly appreciated.
GT
|
|
|
|
|
GaryT80 wrote: Does the getFiles method alter the LastaccessedDate?
I can't really imagine that it would.
Do you have any observations of it doing this?
---
b { font-weight: normal; }
|
|
|
|
|
I think so. I am having it tested as we speak. But it seems that it is altering the files time stamp.
|
|
|
|
|
I have documented the altering of the LastAccessedDate using the GetFiles method. It does not change every file though. I am finding this to be very odd.
|
|
|
|
|
How do you check if LastAccessedDate has changed?
If you for example check the properties in explorer, it might read the file to get some properties. If it's a media file, for instance, it will read the file to find out things like duration, resolution and bitrate.
---
b { font-weight: normal; }
|
|
|
|
|
I am using a proprietary assembly to extract all metadata and properties from files. I know this is not the culprit in the situation. the code I am using to process a directory is as follows:
Public Function ProcessDirectory(ByVal targetDirectory As String) As String()
Static tcnt As Integer
Static tfiles As String()
Static cnt As Integer = 0
Dim fileEntries As String() = Directory.GetFiles(targetDirectory)
' Process the list of files found in the directory.
Dim fileName As String
For Each fileName In fileEntries
ReDim Preserve tfiles(tcnt)
tfiles(tcnt) = fileName
tcnt = tcnt + 1
Next fileName
Dim subdirectoryEntries As String() = Directory.GetDirectories(targetDirectory)
' Recurse into subdirectories of this directory.
Dim subdirectory As String
For Each subdirectory In subdirectoryEntries
ProcessDirectory(subdirectory)
Next subdirectory
Return tfiles
End Function
Maybe you all can see something that I am not.
GT
|
|
|
|
|
GetFiles shouldn't do it, but right-clicking the file and clicking Properties WILL change the LastAccessed time on files stored on NTFS volumes. It's better to rely on the Modified date and time, not LastAccess.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i have to build blackjack for my project and im having difficulty with the class for the cards. i can get the number to work i am unsure on how the suits work. has anyone built a playing card class at all? many thanks if u could help!
|
|
|
|
|
I wrote classes for card and deck as an example not so long ago. Search for it in the forums.
---
b { font-weight: normal; }
|
|
|
|
|
I was wondering if anyone had a good solution to replacing VB6.FixedLengthStrings(). I need to be able to have a constant length for strings in a function. I tried Dim str As String = Space(#), and that works fine until you set the string to its value (spaces disappear), so its apparent that is not the correct way to fix this problem. Ive been thinking about testing to see the difference between the max length of the value and the max length of the string, but I'm not sure how to put a certain number of spaces to the end of the string as you cannot insert spaces with string.insert(pos, chars). Any thoughts?
Nathan Lindley
|
|
|
|
|
<VBFixedString(15)> Dim sVal as string
Or
CONST MIN_SIZE as int16 = 15
Dim s As String = ""
s = "Hello"
s = s.PadRight(MIN_SIZE, " ")
|
|
|
|
|
Tried the first one but it was to no avail, but the second one is money. Thanks.
Nathan Lindley
|
|
|
|
|
Does anyone know how to make a picturebox control where it is always centered on the form. I have an MDI parent form that is always maximized but depending on the size of the monitor the picture box in the middle isnt always in the middle. I need a way to set this picture box to always be in the center of the form. Thank you.....
|
|
|
|
|
Private Sub Form2_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState <> FormWindowState.Minimized Then
With PictureBox1
.Left = (Me.ClientRectangle.Width / 2) - (.Width / 2)
.Top = (Me.ClientRectangle.Height / 2) - (.Height / 2)
End With
end if
End Sub
|
|
|
|
|
I do the same thing with a label. I first centered it on the form through the format menu, and then I just anchored it on all four sides. The text is centered both vertically and horizontally in the label. As the font size won't change it doesn't matter that the label gets stretched. I don't know however what happens to the image in a picture box, but otherwise it should work the same way.
Johan
|
|
|
|
|
Hi All
I'd like to know how to cancel a print job (using VB) if the user presses the CANCEL button when the print dialog shows. Any ideas?
thanks in advance
|
|
|
|
|
Do anyone know the code to check to see if a row in a file contains any characters such as commas and quotes. For example:
If row("PartNumber").ToString()contains comma or single quote then
'do something
End If
jds1207
|
|
|
|
|
Dim dsTbl As New Data.DataTable("Test")
Dim dsRow As Data.DataRow = Nothing
dsTbl.Columns.Add(New Data.DataColumn("col1", GetType(String)))
dsTbl.Columns.Add(New Data.DataColumn("col2", GetType(String)))
dsTbl.Columns.Add(New Data.DataColumn("col3", GetType(String)))
For i As Int16 = 0 To 10
dsRow = dsTbl.NewRow
dsRow("col1") = Chr(65 + i)
dsRow("col2") = Chr(66 + i) & ","
dsRow("col3") = Chr(67 + i) & "."
dsTbl.Rows.Add(dsRow)
dsRow = Nothing
Next
For i As Int16 = 0 To dsTbl.Columns.Count - 1
For Each dsRow In dsTbl.Rows
If CStr(dsRow(i)).IndexOf(".") > -1 Then
'code for period
ElseIf CStr(dsRow(i)).IndexOf(",") > -1 Then
'code for comma
Else
'code for neither
End If
Next
Next
|
|
|
|