|
how can i read and add items from notepad and print them to listview in form vb.net
kilany
|
|
|
|
|
You mean how can you read a text file ? Notepad has nothing to do with it, it's just a program that reads text file. System.IO.File.ReadAllText is the easiest way to read a file.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i send message from vb.net to another application .. the send operation is done successfully but the problem is some times the message change by adding a character or repeat character such as if :
dim s as string ="42945:dn"
send.sendwait(s)
the message will print as 42945:dn but some time will print in the another application 442945:dn and some time 442294::dn really i dont know why ...
some friend advice me to use Trim function but i dont know if it will do as i want or no...
please this is the 15 time that i ask you to help me and give me the function that keep the string as i defined it before send it to another application but unfortunatlly no answer ..
keep me in ur mind.
kilany
|
|
|
|
|
This is absolutely the LAST time I'm going to say this. THERE IS NOTHING WRONG WITH THE CODE!! You're using SendKeys to send this data to another application, which is notoriously unreliable! The value of the variable is NOT changing when you call SendKeys. The problem is that your destination application isn't cooperating with SendKeys! Is there anything you can do about it?? Short of seeing if you can get an updated version of the target application, no, there isn't...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
BUT THIS PROBLEM WILL BE ALSO IF THE DESTINATION IS NOTEPAD PLEASE TRY TO USE SEND() FUNCTION BETWEEN MINIMIZE AND MIXIMIZE THE WINDOW THEN YOU WILL FIND SOME THING BUFFER OR SOME THING CHANGE LESS OR MORE CHARACTER WILL ADDED TO THE ROOT STRING ... SO THE PROBLEM NOT THE DISTINATION BECAUSE I USE THE FUNCTION IN MANY TARGET APPILCATION ...
I THINK THE PROBLEM IS THE DELAIY .. I NEED TO KNOW HOW I CAN DELAIY THE FORM WHEN I MINIZE IT .. THIS IS THE LAST CHANCE TO USE IT ...BECAUSE THE PROBLEM THAT IT PRINTS ALL STRING IN SMALL PERIOD LESS THAN 1 SECOND
kilany
|
|
|
|
|
If you can't send keys to Notepad properly, I'd say you have a problem with your system. notepad is nothing but a glorified TextBox control.
During this entire time, you never once mentioned WHY your trying to control another application and even WHAT that application is. I've already said that you have to look for other methods that are reliable, like an SDK or COM component for that application. Now, you've just about run out of time to look...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
There is no level on which you can send one number and recieve another. It's got to be the way in which the number is being handled in code. What's send ? Are you using WM_COPYDATA to send stuff between applications ? If not, what are you using ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The mother of all f-up's: SendKeys
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
more details .... pls if you have a soluation of my problem just tell me where and how can i search by google .. and about what ...
kilany
|
|
|
|
|
I use a usually string character or number but the problem that randomlly after some click on button which make send string ,, the send() function add or remove some character or number ... so how can i delay the message according to time .. that mean i think i should not print all the message one time..
kilany
|
|
|
|
|
As you may have noticed by the discussion that happened around this question, what you're doing is just plain terrible. It's just not the right way to go. You have options that are sensible, mainly the ones I listed when I asked. You never answered, BTW, without Dave's comment I'd be even less able to help you. The best help I can offer is to scrap what you're doing, and do it properly.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
In my application I have a form with some comboboxes on it. These comboboxes are all bound to different datasets. When the form shows, I can select a different index in the combobox, the text is adjusted as expected. To here, I encounter no problems.
In some cases, when the form is loaded, I want to select a value in the combobox that I obtained by accessing my database.
Example of my code:
cboIncidentType.SelectedValue = curIncident.IncidentErrorType
Now, for some reason, the selectedValue is not set to what I define in my code, but to the first index in the combobox.
Can someone tell me what the problem is?
Thanks!
G72360
|
|
|
|
|
This depends on when this code is being called. If you're doing this at the beginning of the Form_Load event, the ComboBoxes haven't been filled yet...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The comboboxes are filled before the selectedValue is set.
When selectedIndex 0 is returned, the datafield (text) of index 0 is shown, only it is not the index I tried to set.
G72360
|
|
|
|
|
I have icluded an SQL database file in my application and it now uses sqlexpress to attach that and use that file. It workes good but now I have to deploy sqlexpress 2005 with my application and it requires SP2 for Windows XP. Is there any other way I can use this SQL file without forcing all the customers to install SP2?
Any help is good because I'm desperate.
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
Nikola Knezevic wrote: Is there any other way I can use this SQL file without forcing all the customers to install SP2?
Nope. It's the minimum system requirement for 2005. An older version MSDE, like MSDE 2000, on the other hand, doesn't require SP2. This will, of course, depend on your applications requirements.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If MSDE 2000 can handle connection string below then you have solved my problem:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ptcdb.mdf;Integrated Security=True;User Instance=True
But then I have one more question How can I add it in my prerequisites list in vs 2005?
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
MSDE was the predecessor to SQL Express. The name changed when 2005 came out.
Nikola Knezevic wrote: How can I add it in my prerequisites
What prerequisites list??
I think you might be looking for something like this[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
OK so far I managed to do everything but connecting to msde none of the connection strings I've tried worked.
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
Is there a way to override the code that vb.net generates for Deletes, Updates and Inserts?
The code generated is slowing down my app for these functions, especially for only 1 record.
I'm using the BindingNavigator controls to add, update, delete, etc.
PPOBindingSource.EndEdit()
PPOTableAdapter.Update(Me.DwCustomDataSetPPO.BenefitAdj_PPO)
Is there someway to over ride what Vb generated and create mo own code for these functions?
The generated code is inefficient and convoluted.
Any help greatly appreciated.
Mike
|
|
|
|
|
Can any one tell me how to deploy a web application?... where as the web application module uses a web service for some applications...
thanks
with regards ,
K.Vijaya
|
|
|
|
|
Developing a windows application with VB.Net under VS 2005. I am wondering if anyone knows how I can prevent validation events from firing if the user clicks on the control box close button to exit a form. I do not want to set the CausesValidation property on all of the form controls to False as I do want validation events to fire if the user is tabbing from control to control. However, the control box close button presents an apparently ugly issue because, when clicked, not only does the validation event for the control being exited fire but the FormClosing event still fires even if the validation event fails and the program issues a Cancel. Has anyone else run across this problem and found an elegant solution?
Thank you...
|
|
|
|
|
Well, the most "elegant" solution I've come up with so far is that the cancel property of the FormClosingEventArgs is set to True at the start of the event when a control just failed validation. So, I can check that property and if it is set to True as soon as the event starts, just skip any other code in the event. I would feel better about this solution if I could trust Microsoft not to change the behavior of CausesValidation to something that actually makes logical sense in a future update or revision. If anyone thinks they have a better solution, please let me know.
|
|
|
|
|
Hello!
I am using TSQL to add to access based database. I have been getting syntax error in INSERT INTO statement. Here is the statement. If you can recognize the error please let me know. Myrequest is a collection and it is working fine.
Thanks!
Dim SrchKey
SrchKey = "INSERT INTO Estates "
SrchKey = SrchKey + "(status,stockno,portfolio,type,city,town,suburb,rooms,heating,age,floor,size,price,exchange,properforcredit,"
SrchKey = SrchKey + "opportunity,listdate,deposit,depositamount,showmainpage,description,picture1,picture2,picture3,picture4,"
SrchKey = SrchKey + "picture5,picture6,RecordStatus,SoldRent,HitCount) VALUES ("
SrchKey = SrchKey & myRequest("status") & ","
SrchKey = SrchKey + "'" & myRequest("stockno") & "',"
SrchKey = SrchKey + "'" & myRequest("portfoy") & "',"
SrchKey = SrchKey + myRequest("type") & ","
SrchKey = SrchKey + myRequest("city") & ","
SrchKey = SrchKey + "'" & myRequest("town") & "',"
SrchKey = SrchKey + "'" & myRequest("suburb") & "',"
SrchKey = SrchKey + "'" & myRequest("rooms") & "',"
SrchKey = SrchKey + "'" & myRequest("heating") & "',"
SrchKey = SrchKey + "'" & myRequest("age") & "',"
SrchKey = SrchKey + "'" & myRequest("floor") & "',"
SrchKey = SrchKey + "'" & myRequest("size") & "',"
SrchKey = SrchKey & clng(myRequest("price")) & ","
SrchKey = SrchKey + "'" & myRequest("exchange") & "',"
SrchKey = SrchKey & myRequest("properforcredit") & ","
SrchKey = SrchKey & myRequest("opportunity") & ","
SrchKey = SrchKey + "'" & myRequest("listdate") & "',"
SrchKey = SrchKey & myRequest("deposit") & ","
SrchKey = SrchKey & myRequest("depositamount") & ","
SrchKey = SrchKey & myRequest("showmainpage") & ","
SrchKey = SrchKey + "'" & myRequest("description") & "',"
SrchKey = SrchKey + "'" & SetFileName(0) & "',"
SrchKey = SrchKey + "'" & SetFileName(1) & "',"
SrchKey = SrchKey + "'" & SetFileName(2) & "',"
SrchKey = SrchKey + "'" & SetFileName(3) & "',"
SrchKey = SrchKey + "'" & SetFileName(4) & "',"
SrchKey = SrchKey + "'" & SetFileName(5) & "',"
SrchKey = SrchKey & -1 & ","
SrchKey = SrchKey & False & ","
SrchKey = SrchKey & 0 & ");"
|
|
|
|
|
Its near on impossible to tell you what the syntax error is from what you have provided, but here are some tips.
1) You are mixing '+' and '&' for string concatentation - pick one and stick with it.
2) You should not be building up a SQL query in this way, it is unsafe and leaves you open to SQL Injection attacks.
3) Try writing out the content of SrchKey after building this string to a messagebox (for example) - it will help you spot the error (Which is likely to be a missing quote, or a missing comma)
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|