|
Hi all,
How would i go about inserting a breakpoint after each 500th character. You see, i have created a flat file using ssis. This packaged reads records from a database and writes it into a flatfile with fixed length. BUT the records do not get written underneath each other... The get written next to each other and this is then a problem when i need to write the final flat file (a combination of three flat files).
The records (read from the database [sql]) gets written like this:
Text Line1Text Line2Text Line3
I want it:
Text Line1<br />
Text Line2<br />
Text Line3
To do this (i think) i need to do something like this...
Read the text line from the datafile into a variable. (this is the text file with the datarecords next to each other)
Take the length of the variable and devide it by 500. (This is because each record / text line is only 500 characters long. This will then be stored in another variable called: Lines )
Then i do a for loop for each line, taking the first 500 characters from the variable and writeln it into the text file. Now delete/remove the first 500 characters from the variable (as to not write them again) and do the same with the next 500 characters until the end of the Lines loop ended.
I dont know if this could be prevented (what i mean is: Can you tell the SSIS Flat File Destination control to write each record into a new line??) if NOT do you think my theory would work using vb.net code?
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Never Mind...
I figured it out.
I inserted a new breakpoint (using writeline) after every 500th character.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
hi all,
i am facing a problem while i try to make a setup of my project/application built in vb.net 2003.
i am useing setup wizard, when i try to buld solution or build set up the following error message appeaed.
" Error No.1706 valid source could be found for product. VS.net Enterprises Architect 2003-3 English the windows installer can't continue.
kindly anyone help me.
Thanks
rmshah
Sr. Developer
|
|
|
|
|
hi
Am not sure about the Error, but i have googled this, just spend your time on this
http://www.pcperformancetools.com/error1706.htm[^]
Hope it Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi. I would be considered beginner at VB so I hope this question is not bad.
I am working on a genetic algorithm for TSP problem. I will try describe what I am trying to do. I am try to create 10 x 10 matrix has zeros across in cells diagnal from upper left to lower right. For example: in TSP problem distance from point A to A, B to B, C to C, etc will have be zero. I am create random integers from 1 to 100 for other distance. So upper right and lower left must be also symetric. I can create matrix so each cell is random but can not do previous stated problem.
I hope this makes sense.
Any help is many appreciated.
|
|
|
|
|
Have you made any progress in this?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Yes, it was just a matter of entering:
_Array(y, x) = _Array(x, y)
_Array(x, y) = 0
_Array(x, y) = _Array(y, x)
in the middle of my nested for/next loop.
Thank you for the interest though.
|
|
|
|
|
Are you going to do an article here about your TSP project?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi, I have develop any application in vb2005. My application connect to ms. access database. i used textbox to display information and editing in my application. My problem challenge when i try to format the number in currentcy and return the value back to the database when user need to update the value.
In my database there is one field has datatype as currentcy. When its display in the textbox i use the code format(value, "$ #,###.##") to display the value. For example, 6000 display $ 6,000.00 . The problem is when i try to save the value back to the database, the value $ 6,000.00 will cause the problem because $ , and . character is not a valid character.
So, how could i code my application to take only 6000 value from the textbox which contain $ 6,000.00 value? Do i need to use any custom control?
Thank in advance!
|
|
|
|
|
You can change the control to not accept those keys, but if you like the way it displays, just string the string before you insert it, as in
currency = txtCurrency.Text.Replace("$", "").Replace(",", "")
That will replace $ and , with empty strings, giving you the format your DB requires
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Thank you very much for your answer. I will try to solve the problem with the above advice
|
|
|
|
|
Hi all,
recently i migrated vb6 to vb.net and in vb.net i have developed an application using MsSql-7 as backend.
now i want to prepare a setup so i can install all needed file to the target computer.
kindly help me as i am new in vb.net, How can i loaded all needed files in setup.
specialy database
i used setup wizard but can't caryy database files
thanks in advance
rmshah
Sr. Developer
|
|
|
|
|
Your issue is, your user needs to install SQL Server ( which is not free, unless you can use the Express Edition ) and then either attach to an existing blank DB, or run a script to create it. It's not as simple as deploying an MDB file.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
can any1 there help mi on a sms program... i am totally new to this so its rather hard for mi.. what i need to do is a restaurant sms system when user sms to this particular no. den it will reply him via a table no.
|
|
|
|
|
Jaysentan wrote: any1
Jaysentan wrote: mi
Jaysentan wrote: den
Most of us are older than 8, please use English.
Why are you using VB6 ? It's outdated, unsupported and it sucks. I know there are webservices around for SMS, but why do you want to use SMS ? How does SMS come into play ? If the user is booking online, why would they need SMS for the number ? You can't run VB6 on a phone, can you ?
When you say you're 'new to this' do you mean VB6 or SMS ? Why are you wanting to write this ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Dim index As Integer
index = listbox1.SelectedIndex
listbox1.Items.RemoveAt(index)
The above code is used to remove the seleceted item from a listbox. However the program crashes when the button is clicked and no item is selected. How can I correct??
|
|
|
|
|
Check the value of SelectedIndex before you use it. SelectedItem will be -1 if there is nothing selected.
You might also want to check to see if the number of Items in the Items collection (see it's Count property?) is greater than zero before you try to remove something from it.
|
|
|
|
|
You asked this question yesterday and I answered it[^].
Which part of my advice did you not understand?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Maybe he wants to be sure, but very sure, so he asks to the whole village!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
As the other posters above have stated, SelectedIndex will return -1 if there is nothing selected, so all you have to do is write an IF statement around it.
Dim index As Integer<br />
<br />
index = listbox1.SelectedIndex<br />
If index > -1 Then listbox1.Items.RemoveAt(index)
|
|
|
|
|
Can you help me solve this problem?
I’m using VB.NET 2005 and I’m trying to create a Server Application which can be early bound to by two Client Applications and exchange data between them via the Server Application.
Scenario: There are three applications ClientApp1.exe, ClientApp2.exe & ServerApp.dll all residing on the same server/workstation.
The 2 ClientApps are both manually started and both early bind to the ServerApp.
ClientApp1 sends a message to ClientApp2 via the ServerApp.
ClientApp2 replies to ClientApp1 via the ServerApp.
Do you know how I can create a ServerApp in VB.NET to achieve this?
Every time I create a ServerApp.dll (with a singleton class) and run the two ClientApps they both see different instances of the class.
I think the ClientApps are creating multiple instances of the ServerApp.dll. How do I stop this from happening?
ServerApp.dll
Public Class clsServerApp<br />
Private mstrStartup As String<br />
Private Shared myInstance As clsServerApp<br />
Public Shared ReadOnly Property GetInstance() As clsServerApp<br />
Get<br />
If myInstance Is Nothing Then<br />
myInstance = New clsServerApp<br />
End If<br />
Return myInstance<br />
End Get<br />
End Property<br />
Private Sub New()<br />
mstrStartup = "clsServerApp [Creation Time: " & DateTime.Now.ToString() & "]"<br />
End Sub<br />
Public ReadOnly Property Startup() As String<br />
Get<br />
Return mstrStartup<br />
End Get<br />
End Property<br />
End Class
ClientApp1.exe & ClientApp1.exe
Public Class frmClientApp<br />
Private objServerApp As ServerApp.clsServerApp<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
TextBox1.Text = objServerApp.GetInstance.Startup<br />
End Sub<br />
End Class
Both ClientApp1.exe & ClientApp1.exe early bind to ServerApp.dll but when run both receive different times proving that the singleton class is produces twice...
Regards
Andy
|
|
|
|
|
What does the code look like that's hosting your server object? Are you using a configuration file or creating it in code?? What does that look like??
|
|
|
|
|
Sorry Dave I don't really understand your question as I'm new at this?
I created a new project called ServerApp using a ClassLibrary as a template in VB.NET 2005. Then created a singleton class as in my code snippet in my original mail. Then selected Build ServerApp which created a ServerApp.dll
I then created two test ClientApps (as in my first mail) to read the time the ServerApp was created expecting the same time in both my ClentApps but I was wrong. The ClientApps were early bound to the ServerApp.
Both ClientApps returned different ServerApp creation times suggesting that they were creating their own instance of the ServerApp.
I'm trying to create a ServerApp that can exchange data between bound ClientApps.
Regards
Andy
|
|
|
|
|
Andy Dale wrote: Then selected Build ServerApp which created a ServerApp.dll
The .dll doesn't do you any good if it's not hosted in a 3rd application. The .DLL is being used directly by your client apps. Each is getting it own copy of the .DLL, and hence it's own singleton version of it.
Have you looked into .NET Remoting at all?? Or, if using .NET 3.0, WCF??
|
|
|
|
|
two.My.Settings.turveset = "false"
I want to write data back to my config file with the statement above but get an error message saying "property turveset is readonly". searched help for it but couldnt find how to make it readwrite or something.
help response for error message:
You have tried to assign a value to a property that is declared ReadOnly.
Error ID: BC30526
To correct this error
Remove the ReadOnly specifier from the property declaration.
How to i do that?
|
|
|
|