|
oh... i think i understand what you mean... it could be that it is reading all the lines at the same time so in memory it is:
"Test line1Test line2Test line3" and that is why it is writing the whole line "Test line1Test line2Test line3" and then inserting the break.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Okay
It appears that you were right...
Thank you.
The source file used to read the text lines from is where the problem is... the text is Test line1Test line2Test line3 (so i have to fix the source file) thank you.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Sorry to be bothering you again...
You would know by any chance how to add a break point when using a "Flat File Destination" in SSIS. I want to add a break point after each row from the table... as it stands now... the table rows get written next to each other in the flat file.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
I have a datagridview control in which i have got a column of type DataGridViewComboBoxColumn. I populate this column's combo when I load the form. But while running if i click on the column's drop down button, so that I can view the list of data in the combobox of the column, it takes 2-3 seconds to show me the list. How can I speed up this drop down of the list so that I can make the application faster.
Thanks in Advance.
Sekhar
|
|
|
|
|
You got your answer here[^]. It's a shame you chose to ignore what Christian posted and just restate your question.
Again, how many items are in this combo?? Where is the data comming from?
|
|
|
|
|
Hi! I couldnt maintain the state of the treeview after postback. searched all over but i could seem to solve the problem. below is the code that i am using so it will be easier to understand whta i am doing.
Imports System.Data.SqlClient
Imports System
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI.WebControls
Partial Public Class tree
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
PopulateRootLevel()
End If
TreeView1.CollapseAll()
' get the saved state of all nodes.
Dim treeViewState As New TreeViewState()
treeViewState.SaveTreeView(TreeView1, Me.GetType.ToString())
End Sub
Private Sub PopulateRootLevel()
Dim objConn As New SqlConnection("server=APEX-KEV3;uid=sa;pwd=password2133;database=TaxnologyOnlineDev")
Dim objCommand As New SqlCommand("select LocationId,LocationName,(select count(*) FROM Location " _
& "WHERE parentlocationid=sc.locationid) childnodecount FROM Location sc where parentlocationID is null and locationid=3", _
objConn)
Dim da As New SqlDataAdapter(objCommand)
Dim dt As New DataTable()
da.Fill(dt)
PopulateNodes(dt, TreeView1.Nodes)
End Sub
Private Sub PopulateNodes(ByVal dt As DataTable, ByVal nodes As TreeNodeCollection)
For Each dr As DataRow In dt.Rows
Dim tn As New TreeNode()
tn.Text = dr("locationname").ToString()
tn.Value = dr("locationid").ToString()
nodes.Add(tn)
'If node has child nodes, then enable on-demand populating
tn.PopulateOnDemand = (CInt(dr("childnodecount")) > 0)
Next
End Sub
Private Sub PopulateSubLevel(ByVal parentid As Integer, ByVal parentNode As TreeNode)
Dim objConn As New SqlConnection("server=APEX-KEV3;uid=sa;pwd=password2133;database=TaxnologyOnlineDev")
Dim objCommand As New SqlCommand("select LocationId,LocationName,(select count(*) FROM Location " _
& "WHERE parentlocationid=sc.locationid) childnodecount FROM Location sc where parentlocationID=@parentID", _
objConn)
objCommand.Parameters.Add("@parentID", SqlDbType.Int).Value = parentid
Dim da As New SqlDataAdapter(objCommand)
Dim dt As New DataTable()
da.Fill(dt)
PopulateNodes(dt, parentNode.ChildNodes)
End Sub
Protected Sub TreeView1_TreeNodePopulate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TreeView1.TreeNodePopulate
PopulateSubLevel(CInt(e.Node.Value), e.Node)
End Sub
Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TreeView1.SelectedNodeChanged
If TreeView1.SelectedNode.Value <> String.Empty Then
Response.Redirect("tree.aspx?id=" + TreeView1.SelectedNode.Value)
End If
End Sub
Protected Sub TreeView1_Unload(ByVal sender As Object, ByVal e As EventArgs) Handles TreeView1.Unload
' save the state of all nodes.
Dim tvs As New TreeViewState
tvs.SaveTreeView(TreeView1, Me.GetType().ToString())
End Sub
End Class
Public Class TreeViewState
Public Sub SaveTreeView(ByVal treeView As TreeView, ByVal key As String)
Dim list As New List(Of System.Nullable(Of Boolean))()
SaveTreeViewExpandedState(treeView.Nodes, list)
HttpContext.Current.Session(key + treeView.ID) = list
End Sub
Private RestoreTreeViewIndex As Integer
Public Sub RestoreTreeView(ByVal treeView As TreeView, ByVal key As String)
Dim list As New List(Of Nullable(Of Boolean))
If HttpContext.Current.Session(key + treeView.ID) IsNot Nothing Then
list = CType(HttpContext.Current.Session(key + treeView.ID), List(Of Nullable(Of Boolean)))
End If
RestoreTreeViewIndex = 0
RestoreTreeViewExpandedState(treeView.Nodes, list)
End Sub
Private Sub SaveTreeViewExpandedState(ByVal nodes As TreeNodeCollection, ByVal list As List(Of System.Nullable(Of Boolean)))
For Each node As TreeNode In nodes
list.Add(node.Expanded)
If node.ChildNodes.Count > 0 Then
SaveTreeViewExpandedState(node.ChildNodes, list)
End If
Next
End Sub
Private Sub RestoreTreeViewExpandedState(ByVal nodes As TreeNodeCollection, ByVal list As List(Of System.Nullable(Of Boolean)))
For Each node As TreeNode In nodes
If RestoreTreeViewIndex >= list.Count Then
Exit For
End If
node.Expanded = list(System.Math.Max(System.Threading.Interlocked.Increment(RestoreTreeViewIndex), RestoreTreeViewIndex - 1))
If node.ChildNodes.Count > 0 Then
RestoreTreeViewExpandedState(node.ChildNodes, list)
End If
Next
End Sub
End Class
i am using visual studio .net 2.0 treeview control
please help
thanks
|
|
|
|
|
This question really belongs in the ASP.NET forum. It really has nothing to do with VB.NET.
But, I'm no expert in ASP.NET, but take a look in this code in your Page Load event:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
PopulateRootLevel()
End If
TreeView1.CollapseAll()
' get the saved state of all nodes.
Dim treeViewState As New TreeViewState()
treeViewState.SaveTreeView(TreeView1, Me.GetType.ToString())
End Sub
It would appear that you're collapsing all the treenodes in the tree on every postback, then saving the closed up state, which you don't even need to do since you're letting the state you saved drop out of scope.
|
|
|
|
|
Well, as you all might know by now, I'm new to vb.net. My question is, how would you delete a line of text from a text file without leaving the space? and is this possible without using 'buffers' or temp files , just the built in functions ... i hope this makes sense ...
gHoSt
|
|
|
|
|
The only way to modify a file is to read it all, modify it in memory and write it out again.
I do believe the File class has static methods which wrap all of this, but internally, that's the only way it can be done.
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 )
|
|
|
|
|
well you are already putting these lines in to an array correct? Try to remove the line from the array then write all the elements from the array as the new content.
|
|
|
|
|
I have a vb6 activex control to print PDF and an HTML page one after the other.
ActiveX control uses webbrowser control to print html page.
I use the following Code to print html in vb form containing web browser control:
Private Sub wbrPrintHTML_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
wbrPrintHTML.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
End Sub
This control is accessed from asp.net application using javascript.
Application needs to print multiple PDF documents and html pages in the sequence pdf1,html1,pdf2,html2...
When this code is executed , in win XP ,it follows the right sequence (pdf1,html1,pdf2,html2...)
in the print queue.
In win 2000 sp4 and sp3 machines, the print queue changes to PDF1,PDF2,Html1...
Please suggest as how to resolve this.Is there any way to get information when the html printing is completed?
How to get the proper print queue sequence in win 2000 sp4 and sp3 machines?
Ravi
|
|
|
|
|
This question belongs in the web development forum. This would have to be done entirely client-side in JavaScript, though I have no idea how to do it.
Also, code running inside a browser session has no permissions to get any information about the machine it's running on. I'm guessing that the print queue configuration would be off-limits to your JavaScript code.
|
|
|
|
|
Hello,
Im basically just trying to find a way to fade in and out a button in VB.net - i just can't find anything on the internet to tell me how i could do this so I haven't even attempted myself.
I was wondering if anyone knew anything to start me going? or any URLs?
Any help would be amazing! thanks!
|
|
|
|
|
Just use a timer and set the opacity of the control.
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 )
|
|
|
|
|
The controls don't have an Opacity property. Only the Form class does.
He'd have to put the controls in a Form container, set it's BorderStyle to None, create an instance of it at runtime, set it's TopLevel property to False, and then treat it like a Panel control. Follow??
|
|
|
|
|
And a quick test shows that little "cheat" doesn't work either. It looks like it's the entire form or nothing, using standard .NET properties.
He's probably have to go as far as creating his own "Layered Window" implementation of Control, then building his controls on top of that class.
Or, just do it the easy way and use WPF...
|
|
|
|
|
I have two databases I open. The first is a list of customer numbers I have to open in an oledb connection. The second is the master customer table with customer number and address info--this is opened with a sqldb connection. The fields in both are the same in respects to the data I'll be accessing. I need to somehow add the address info to the first table from the second. I'm wondering if there is anyway to do something like:
update oletable
set oletable.street=sqltable.street
set oletable.city=sqltable.city
set oletable.state=sqltable.state
set oletable.zip=sqltable.zip
where oletable.cust_no=sqltable.cust_no
doubt my syntax is correct but you see what I wish to do.
I'm just not sure if this is even possible since the two tables resite in different databases and the first can only be opened via oledb connection.
Can anyone help?
|
|
|
|
|
What is your first data source, the one you are accessing via an OLEDB connection? You might be able to set it up as a linked server in your SQL Server, allowing you to run queries that directly reference both databases.
Have a look at this article[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I toyed with that for a couple hours this AM. It didn't like the name of the sheet in excel but after fixing that I have the table excel sheet added just like the article. Now if only I could get my command to work.
update amyexcel...allanis$
set street=addrlist.street
set city=addrlist.city
set state=addrlist.state
set zip=addrlist.zip
from masterdb.addrlist
where allanis$.phone=addrlist.phone
I wish to update the street, city, state and zip fields in the excel spreadsheet/table allanis$ with the same fields from the addrlist table which is in the masterdb database. Matching them up by the phone field. I'm not a sql expert either and if you could help with this I'd appreciate it.
select top 5 * from amyexcel...allanis$ works from where I'm sitting in SQL query analyzer. I'm not sure how to specify that addrlist is in the master db and I think this is why I'm not getting things to work. How do I get it to understand that allanis$ and addrlist are in different databases?
Thanks.
|
|
|
|
|
Your update query syntax isn't correct. Your query should look something like this
update amyexcel...allanis$
set street=addresslist.street,
city=addresslist.city,
state=addresslist.state,
zip=addresslist.zip
from masterdb.dbo.addrlist addresslist
where amyexcel...allanis$.phone=addresslist.phone
I have assumed that dbo is the owner of the addrlist table.
Try this and let me know how you get on.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
First I got:
Server: Msg 117, Level 15, State 2, Line 8
The number name 'amyexcel...allanis$' contains more than the maximum number of prefixes. The maximum is 3.
So I changed it to:
update amyexcel...allanis$
set street=addresslist.street,
city=addresslist.city,
state=addresslist.state,
zip=addresslist.zip
from masterdb.dbo.addresslist addresslist
where allanis$.phone=addresslist.phone
but now it gives me:
Server: Msg 107, Level 16, State 2, Line 1
The column prefix 'allanis$' does not match with a table name or alias name used in the query.
|
|
|
|
|
Change your query to
update allanis
set street=addresslist.street,
city=addresslist.city,
state=addresslist.state,
zip=addresslist.zip
from amyexcel...allanis$ allanis
inner join masterdb.dbo.addresslist addresslist
on allanis.phone = addresslist.phone
Does this work?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Yes, Thanks! I was afraid it'd come to joins. Tomorrow maybe I can figure out exactly how that works.
Next I think I'll send the results to the person who requested them. I'm sure they will not be happy as only 135 of the 4,000 records had matches. Hey, I can only work with the data I'm given.
|
|
|
|
|
JABOSL wrote: Next I think I'll send the results to the person who requested them. I'm sure they will not be happy as only 135 of the 4,000 records had matches. Hey, I can only work with the data I'm given.
Unfortunately, GIGO is a fact of life for those of us who have to deal with data from end users
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Yes, I also noticed some of the phone numbers they gave me to match up had letters in them! I don't know how they got that--must have been watching to much HeeHaw (BR549). I didn't say anything just let it go.
Thanks for all your help.
|
|
|
|