|
I think I would create a "properties/Settings" app that allows you to select the output printer and store the details in the registry.
Then write your windows service that gets the details from the registry for printing, therefore you can tell Crystal what printer to use rather than the default printer.
With regards to the text file, I would load the text into a Typed Dataset then pass the dataset to crystal as the data source.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi Steve,
Thanks for the reply. I am new to VB programming, can you also provide some code to me.
Thnks in advance.
|
|
|
|
|
Jai Bihar wrote: can you also provide some code to me
To do what?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
for selecting ouput printer and writing and reading details from registry
|
|
|
|
|
Use the PrintDialog control from the ToolBox to select your printer.
I have posted an example of reading the registry here[^]. You should be able to work out how to write the selected printer to the registry, if you look at the Microsoft.Win32.Registry namespace and the ReadEntry Function in the link provided.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi to all,
my problem is hopefully not too stupid, but we do not get the following situation solved:
There are several assemblies :
A, B, C and D
B has references to C and D.
If I perform NUNIT testing against assembly B everything works fine.
Now I wish to test assembly A which references assembly B.
The assemly compiles without errors or warnings and terminates at a certain point with a
"FileNotFound" - Exception that is fired by the CLI because assembly D is not found.
If you look in \bin\debug or \bin\release assembly D is missing; from that point of view the exception is OK.
What I really do not understand is the fact that the missing assembly is not copied into the local AppPath as the others.
All references point to the .dll in the \bin\release - path and have the "local copy" option activated.
If I add a reference to assembly D in assembly A everything works fine.
I would have expected to find assembly D automatically in the \bin path for assembly A.
Environment:
VS2005, .Net 2.0, VB.Net
Thanks in advance for any help.
Regards
Thomas
modified on Friday, May 23, 2008 7:36 AM
|
|
|
|
|
Can somebody tell me the code how to scan a registry.
|
|
|
|
|
Assuming you're using VB .Net, seeing as you don't actually say, take a look at the Registry classes in the Microsoft.Win32.Registry namespace.
|
|
|
|
|
Hey frnd i want to know that in VB there is no registry inbuilt fn. Rite???
In Vb.net i import namespace imports.win32
tell me dat how to create the object for registry class.
|
|
|
|
|
I'm sorry, I don't understand what you mean. Are you working with Visual Basic .NET or Visual Basic 6 (or earlier)?
|
|
|
|
|
I m working with .Net, I want to know from where to start as i do not have any idea.After creating the object,what is the next step.
|
|
|
|
|
As I'm not aware of what your trying to achieve, overall, I can't really suggest anything except taking a look at the MSDN documentation for the classes and finding something that meets your needs. Google is also your friend if you have a specific aim in mind that someone might have done before. Then, if you've got a specific question, ask again. Like most people here I won't give out code until you've got something to show you've had a go yourself first.
To give a pointer, though, the Registry Object includes members that encapsulate the various parts of the Registry, and you can loop over them like any other Collection.
|
|
|
|
|
The following code demonstrates how to read a registry entry. You should be able to build on it to incorporate Write, Delete etc.
Public Enum Root As Byte<br />
CurrentUser = 1<br />
LocalMachine = 2<br />
CurrentConfig = 3<br />
ClassesRoot = 4<br />
Users = 5<br />
End Enum<br />
<br />
Function ReadEntry(ByVal RegistryRoot As Root, ByVal Location As String, ByVal Name As String) As String<br />
Dim regKey As Microsoft.Win32.RegistryKey<br />
Select Case RegistryRoot<br />
Case Root.CurrentUser<br />
regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(Location)<br />
Case Root.LocalMachine<br />
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Location)<br />
Case Root.CurrentConfig<br />
regKey = Microsoft.Win32.Registry.CurrentConfig.OpenSubKey(Location)<br />
Case Root.ClassesRoot<br />
regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(Location)<br />
Case Root.Users<br />
regKey = Microsoft.Win32.Registry.Users.OpenSubKey(Location)<br />
Case Else<br />
regKey = Nothing<br />
End Select<br />
If regKey Is Nothing Then<br />
ReadEntry = Nothing<br />
Else<br />
Try<br />
ReadEntry = regKey.GetValue(Name).ToString<br />
regKey.Close()<br />
Catch<br />
Return Nothing<br />
End Try<br />
End If<br />
End Function
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
hi
I got problem while retrieving records from the active directives
using ado.net code .There are nearly 5000 records ,but I am getting only
1000 records for any search .What may be reason ..please help.
This is the code used for retrieving..
<br />
Dim command As New OleDbCommand("<" & strSearchADsPath & ">", Con)<br />
Dim adap As New OleDbDataAdapter(Command)<br />
Dim cb As New OleDbCommandBuilder(adap)<br />
Dim ds As New DataSet<br />
adap.Fill(ds, "tabUser") <br />
Thanks
Chaitanya
|
|
|
|
|
Hey Chaitanya,
I think you will find the answer on this page[^].
Looks like the trick is along the lines of specifying a value for command.Properties("Page Size") .
Hope this helps.
|
|
|
|
|
Yeah you are when using VB6 but I want to get it in VB.NET
|
|
|
|
|
I have a database field (SQL Server) which is stored as RTF
(e.g.)
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 This is the text string.\par }
The user has to be able to search on this field, but at the moment the WHERE clause in the SQL
(e.g.)
WHERE Field1 LIKE '%view%'
would return the above record.
Is there anyway to search the RTF field, but only match what in in the displayed text???
Thanks,
the_smiths.
|
|
|
|
|
I doubt it very much. I expect you need to add a plain text column to your DB
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ask your question in the SQL Server forum. I believe you may be able to incorporate a Regular Expression in a Stored Procedure or View to remove the RTF formatting from the result of the text column containing the RTF code.
You could then search on the raw text.
I may be leading you up a blind alley, in which case I appologise, but I am fairly sure it can be done.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
If the data already exists in a remote SQL database to which you can only connect via a 300-baud modem link, then it may be useful to have a script that can convert the RTF-formatted document into text-only. Otherwise, my strong suspicion would be that while you could search for non-RTF text within the RTF document using a sufficiently-intricately-constructed query, the performance would be so much worse than searching in a text-only field that the approach should be considered infeasible for anything but the smallest databases.
Searching for text within the RTF field would require that the server convert every record's RTF data into text format every time a search was run. The server's inherent caching facilities wouldn't be able to help much. The only way to usefully cache the converted texts would be to create a new table to hold them; if you're going to do that, you may as well hold them in the original table.
Returning to vb:
-1- What is the best way to extract the text from RTF?
-2- Is there any good way to put a huge amount of formatted text into a RichTextBox, or is that control simply unsuitable for dealing with monstrous (multi-megabyte) files? Using a StringBuilder to make an RTF string was reasonably fast, but importing a large RTF into a RichTextBox can take a really long time--there seems to be something that's O(n^3) or worse that kicks in with big files.
|
|
|
|
|
This belongs in the SQL Server forum.
However, one solution (assuming you have full control over the database server) is to use the free-text search functionality available in SQL Server (even in MSDE with the add-on feature pack available nowadays).
You need to download and install an IFilter driver for RTF - there is one available from Microsoft (search for "ifilter" and "rtf").
You also have to:
a) make the field binary (image) and add a "file type" field containing the string ".RTF" on all rows that contain rtf data.
b) enable free-text indexing on the database and the table (specifying the relevant fields).
c) use free-text search predicates instead of "LIKE" (such as FREETEXT, CONTAINS...).
As an added bonus, you can install IFilters for other file formats, such as PDF (available from Adobe).
Look here[^] for information and examples.
Peter the small turnip
(1) It Has To Work. --RFC 1925[^]
|
|
|
|
|
For: VB .net Express 2005 or 2008.
If have been searching the Internet and various forums for weeks now trying to figure out how to integrate live video in an application I am writing. Nothing I have read or tried seems to fit with what I am trying to do so I am going to explain my application here and hope someone may have an idea.
Application: Automated dart tournament control software to runs dart tournaments for some local taverns I work with. The software will manage all aspects of the tournament and then display on an external television the brackets and which teams are on which boards and other tournament related information. But I want this to be displayed like how espn displays some of its programs. I want a live feed from our cable box displayed in the upper right %65 of the television. I want general information scrolled on the bottom and current tournament status on the remaining left section.
I am using a video to USB adapter on the computer, which works fine in other applications and I have been able to bring it into VB Express 2008 applications with some demo code I have found. But the display in the VB application demo code is subtly choppy and in black and white. I know there has to be a better way to display live video. I just need to display, not capture or record.
Any suggestions would be wonderful. Also, I am generally new to VB coding and getting pointed toward some sample code I could study and learn from would be great. Or even better, a video control I can just drop in.
Thanks,
Ryan Schuster
|
|
|
|
|
Perhaps the input device is set to PAL in your code and is NTSC, or vice versa ?
Absenm wrote: Or even better, a video control I can just drop in.
If you mean a paid one, tvideograbber works great. If you mean a free one, perhaps search the articles on the site.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I will locate the test code I used and see PAL/NTSC. I'll recheck the articles to try to find a free video control but I didn't really see anything in my prior research. I urge others to continue to respond to this thread if you have any ideas (maybe code samples). Thanks.
Ryan
|
|
|
|
|
I have done a lot of video work, and the video feed does get a little shaky and b/w if that setting is wrong. It could be someting else, of course, but I'd look there first.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|