 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-founder Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 4.24/5 (21 votes) |
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers, Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 4.13/5 (156 votes) |
|
|
|
 |
|
 |
Hi All,
Writting an ASP.NET app, I'm connecting to an sql database, connection is 100%, I just need the code to store a column value on a defined variable, I dnt want to diplay it jst the code to read the column value. Dim connCatapult As New OleDb.OleDbConnection("Provider=SQLOLEDB;Data Source=CATAPULT;Initial Catalog=Catapult;Integrated Security=SSPI") Dim daCatapult As New OleDb.OleDbDataAdapter("Select TestUserLoginDetails.UserName, TestUserLoginDetails.Password FROM TestUserLoginDetails", connCatapult) Dim dsLoginData As New DataSet()
Dim strUsername As String = Login1.UserName Dim strPassword As String = Login1.Password
daCatapult.Fill(dsLoginData, "TestUserLoginDetails") Dim strDbUserName As String strDbUserName = ????????????????????
please assist
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Assuming that that query will only return one row, the following should work (but no guarantees):
strDbUserName = dsLoginData.Tables(0).Rows(0).Item("UserName")
EDIT: You may want to build in a check, because in case the query does not return any result you'll get an exception in your code.
My advice is free, and you may get what you paid for.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi!
I have stumble on the keyword WithEvents, here is a code example:
Public Shared WithEvents theOpcServer As OPCAutomation.OPCServer = Nothing Public Shared WtihEvents theOpcGroup As OPCAutomation.OPCGroup
What's the difference with those two declarations compared to:
Public Shared theOpcServer As OPCAutomation.OPCServer = Nothing Public Shared theOpcGroup As OPCAutomation.OPCGroup
OPCAutomation is a reference from a DLL-file which I'm using in my application and OPCServer and OPCGroup are two classes from that namespace.
For my application is doesn't matter if I have 'WithEvents' or not. Can someone explain the 'WithEvents' keyword?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Selecting the word and than pressing F1 gives you the help. Withevents let you select the events possible for that control at designtime
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
WithEvents has one powerful extra feature.
To use your example. Suppose you start with a variable such as
Public Shared theOpcServer As OPCAutomation.OPCServer = Nothing
We also assume you have and event handler somewhere eg.
Public Shared Sub OpcServerEventHandler(sender as Object, e as EventArgs)
With this code every time you assign an object to theOpcServer you need to attach and remove the Event Handlers. eg.
If theOpcServer IsNot Nothing Then RemoveHandler theOpcServer.OpcServerEvent, AddressOf OpcServerEventHandler End If theOpcServer = New OPCAutomation.OPCServer() AddHandler theOpcServer.OpcServerEvent, AddressOf OpcServerEventHandler
Alternatively use the WithEvents keyword and a Handles clause on the event handler sub.
Like this .Net does all the event handler maintenance for you without having to write armfuls of code.
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850)www.JacksonSoft.co.uk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi All, I have a Tabcontrol form with 4 tabs. I want to enable 1 tab ( which will be disabled when the Form loads) and will be enable using some authentication system, i.e. whenever user try to click on the disabled tab, it will prompt for entering some login/password which when matches, will enable the tab. How to implement this?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
AFAIK, you cannot enable/disable the tabe page itself. Although you can do that for the controls that recide in it.
You can handle the MouseClick event of the tab control and check the SelectedTab property. If that is the concerned tab page, show your login form. If the login succeeds, you can enable the controls in the tab page.
You can use delegates to handle the Ok (or whatever submit button you have in login form) button click in the form containing the tab control.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Actually you can disable a tabpage. The Enabled property is hidden and unsupported, however if you type it in the code it does work.
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850)www.JacksonSoft.co.uk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I am looking for a way to createWindowEx and to get the handle of the control just created: I have tried both these ways: callfunc CreateWindowExA, hwnd = CreateWindowExA( but all i get back is a "0", telling me that all is well. Pls, how can i do this. Code in C+ or VB or HotBasic would be great! Thanks...vmars
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
vmars316 wrote: but all i get back is a "0", telling me that all is well.
On the contrary 0 or null is telling you that all is not well. What arguments did you supply to the function. A short code fragment showing the context of the call would be helpful.
Alan.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
Straight from the documentation: "If the function fails, the return value is NULL. To get extended error information, call GetLastError."
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
modified on Sunday, November 22, 2009 3:16 PM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello!
I have to produce a software license number from a PDA's device ID. Whenever a user submits this ID to web site, the new licence number must be produced according to submitted id and then whenever user uses the new license number in the software, the code should resolve the new id according to PDA's device id and confirms it.
For example:
The following is a PDA's device ID (7AAF5100226808010d19-c37ad75c0345) and the new license number should be likely this
(5FC6-88J9-1264-76K8)
How can I produce such algorithm. Is there a code sample? I need a road map to realize the concept.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Use simple hashes based using secret company and product hashes as salts and then combine them all to generate a license hash.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
How about Reversing the produced license key and finding the product of the secret company. Hascode only produces numeric numbers.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Yes but you could then tweak the generated hash to ensure that the generate key is within the ascii printable charachter set.....
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello,
my aim is to insert a table with 100 rows and 2 cols at the end of a document. Next I have to fill every row with a random font-name in the first column and a formatted text with that random font in the second column. A font-type must not be repeated within the next 10 rows.
So here is a code, that does exactly that thing, but I want to find a more performant solution - maybe someone could help me how to optimize it. I know that there are much better ways how to solve this problem, thats why I ask.
Thanks in advance for taking the time,
cherry
Dim where As Range Set where = ActiveDocument.Range(ActiveDocument.Range.End - 1, ActiveDocument.Range.End - 1) Set tablewith_different_styles = ActiveDocument.Tables.Add(where, 100, 2, _ DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed) i = 0 g = 1 Do While i < 5 Do While g < 21
tablewith_different_styles.Cell((i * 20) + g, 1).Select Selection.Font.Name = FontNames(g + 20) Name_Font = Selection.Font.Name Selection.Font.Name = "Courier New" Selection.Font.Size = 9 Selection.TypeText Text:=Name_Font Selection.MoveRight Unit:=wdCell Selection.Font.Name = FontNames(g) Selection.Font.Size = 9 Selection.TypeText Text:="My Formatted Text in every Row." g = g + 1 Loop g = 1 i = i + 1 Loop
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
This looks pretty simple and efficient to me. The only other approach that might make this process faster is by going through XML. Maybe code creating the word file in xml format (but saving it as word) might execute faster.
My advice is free, and you may get what you paid for.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for your answer. But it is not what I'm looking for.
The problem is: I know this works usually much faster - the table gets inserted and filled in less than 2 seconds - there has to be another way and sadly I'm totally new to VB. I would be happy if someone had another tweak for me...
Thx cherry
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You said, you know that it usually works faster. It might help, if you could explain how you used to do it. What changed?
My advice is free, and you may get what you paid for.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi all,
I want to read and write the additional informations you can set to a image about windows explorer (right klick on image -> propertys -> fileinfo).
[]
How can I do this in VB.Net?
I try the EXIF-Data of an image, but there I can't find these informations.
Thanks all for help
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You should probably look into System.IO, System.Drawing and the Image class.
My advice is free, and you may get what you paid for.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi all,
in System.IO.Drawing.Imaging I only found the PropertyItems. But in the PropertyItems I can't find the Attributes I wan't to use.
Screen
By GoogleSearch I find out, that these informations are stored in ADS (Alternate Data Stream).
Has anybody a solution for reading, writing and searching these data?
Thanks all
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |