|
Instead of trying to do like this,
use a button without any postback property
and on the button_click event
write something like this:
----------------------------------------------------
Use sessions to store the value of the 2 controls.
Response.Redirect("Page2.aspx")
----------------------------------------------------
In the page load event of the second page:
----------------------------------------------------
Use sessions to retrieve the session values.
----------------------------------------------------
Regards,
Arun Kumar.A
|
|
|
|
|
Good idea...
Can i not store the values in session variable anyway..? Even using a postback? Or post on?
|
|
|
|
|
And how do i get the value of th dropdown into a sesion variable?
|
|
|
|
|
Session("myTxt") = Dropdown1.Text ' to assign into session variable
myValue = CType(Session("myTxt"), String) 'to retrieve the session variable
Regards,
Arun Kumar.A
|
|
|
|
|
If we set the Postback property to the second page,
the button_click event will not be fired.Hence we cannot assign the
session variables .
I think I am right.
Regards,
Arun Kumar.A
|
|
|
|
|
Hi Everyone.
I need to get the top position of a control relative to the form, regardless of which panel it is docked or placed on.
I am finding that the top attribute of a control (in this case a tree view control) returns top values relative to its panel.
Anyone know any magic to fix this?
fall down 6 times stand up 7
|
|
|
|
|
shubumpkin wrote: am finding that the top attribute of a control (in this case a tree view control) returns top values relative to its panel.
The Location (Left, Top) is alway s relative to the controls parent container.
To get to the form, you have to follow the Parent property of your control to it's parent contain, and keep following it up until Parent returns nothing. When you find that, your code is looking at the Form. A quick and dirty method to do this would be something like:
Public Shared Function GetTopContainerOfControl(ByRef childControl As Control) As Control
Dim currentControl As Control = c
While (currentControl.Parent IsNot Nothing)
currentControl = currentControl.Parent
End While
Return currentControl
End Function
This quick example doesn't have any error handling and CAN go on forever if there is a mistake in the control parent/child chain as an infinite loop will result. Since this doesn't use recursion, there is no danger of overflowing the stack, not matter how many levels deep a control is.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hello everyone !
I built a DLL file using VB.NET 2005.
How can I run its functions/subs with Windows RunDll32.exe command ?
Another question:
How do I retrieve function result if I call it with rundll32.exe ?
<br />
For example:<br />
Rundll32.exe c:\MyDll.dll ,FuncName<br />
Thank you very much,
And have a nice weekend !
Reuven
|
|
|
|
|
|
I tried to follow that article, and I still can't run my dll from Rundll32.
My code (VB.NET):
-----------------
Public Class Class2
<ExportDllAttribute.ExportDll("MSG", Runtime.InteropServices.CallingConvention.Cdecl)> _
Public Sub MSG()
MsgBox("Hello world !!!")
End Sub
End Class
After I compiled the dll into c:\SampleDll.dll I use the command line:
ExportDll c:\SampleDll.dll
(Release mode)
The result was: "Debug: False" in command line.
After that I tried to run my dll in this way:
RunDll32.exe c:\SampleDll.dll ,MSG
The result is system message box saying: "error in c:\sampledll.dll Missing value: MSG"
What am I missing,
Plz. help me.
Thanks,
Reuven
|
|
|
|
|
Hello,
I'm looking for a ZModem-Code in VB.
//Thomas
|
|
|
|
|
Hi,
I have to Get the Table values from sql server 2005 and display it in a DataGrid View in VB.NET 2005 Now I want to Add new record and Edit the values of existing one.
How to do it? Give me sample code..
Thanks in Advance
|
|
|
|
|
hi...I'm working on a clipboard project and i'm stuck at getting the full path and file name of a file that user selects to copy...user selects the file from anyfolder he wants and it can also be a folder... no OpenFileDialogBox used here...thnx
|
|
|
|
|
Dear All,
I am facing problem while reading from csv file. It is containing near around 5000 rows. My code is as follows:
Dim Tsream As TextStream
Dim AllRows() As String
Dim SingleLine() As String
Dim AllColumn() As String
Dim readcontents As String
'Reading data in text stream
Set Tstream = FSO.OpenTextFile(filetoread, ForReading, False)
readcontents = Tstream.ReadAll
'separating data of csv file as rows and storing all rows in an array
AllRows = Split(readcontents, vbCrLf)
'Reading data
For i = 0 To UBound(AllRows) - 1
'separating data as single row and storing columns in an array
AllColumn = Split(AllRows(i), ",")
a=AllCoumn(0)
b=AllCoumn(1)
. ..........
Z=AllCoumn(25)
next
But I am not getting correct value of UBound(AllRows).What may be the reason behind this? Is it due to the fact that many of the coulmns are empty in a row? When I save those csv files as text files and then try to read from the same code, everything works fine till the no. of rows are less than 1000 or so. Please tell me how to resolve this issue.
Thanks and Regards,
Virendra
|
|
|
|
|
Hi,
Check this out.
Private Sub cmdGo_Click()
Dim file_name As String
Dim fnum As Integer
Dim whole_file As String
Dim lines As Variant
Dim num_rows As Long
Dim the_array() As Variant
Dim R As Long
Dim C As Long
file_name = App.Path
If Right$(file_name, 1) <> "\" Then file_name = _
file_name & "\"
file_name = file_name & "test.csv"
' Load the file.
fnum = FreeFile
Open file_name For Input As fnum
whole_file = Input$(LOF(fnum), #fnum)
Close fnum
' Break the file into lines.
lines = Split(whole_file, vbCrLf)
' Dimension the array.
num_rows = UBound(lines)
ReDim the_array(num_rows)
' Copy the data into the array.
For R = 0 To num_rows
the_array(R) = Split(lines(R), ",")
Next R
' Prove we have the data loaded.
For R = 0 To UBound(the_array)
For C = 0 To UBound(the_array(R))
Debug.Print the_array(R)(C) & "|";
Next C
Debug.Print
Next R
Debug.Print "======="
End Sub
Regards,
Manowj
|
|
|
|
|
Hi! Manowj
Thanx for your kind co.operation. But this code is giving error while reading from CSV file. The error is
"Input past end of file" in the following section
' Load the file.
fnum = FreeFile
Open file_name For Input As fnum
whole_file = Input$(LOF(fnum), #fnum)
Close fnum
Though code is going fine with text files.
Thanks and Regards,
Virendra
|
|
|
|
|
Hi! Manowj
Thanx for your kind co.operation. But this code is giving error while reading from CSV file. The error is
"Input past end of file" in the following section
' Load the file.
fnum = FreeFile
Open file_name For Input As fnum
whole_file = Input$(LOF(fnum), #fnum)
Close fnum
Though code is going fine with text files.
Thanks and Regards,
Virendra
|
|
|
|
|
Hi All,
I want to generate a Data Report from VB6.0 without Database(MSACCESS, Oracle etc..).
I want to read the data from .txt file and to generate a Data Report in VB6.0.
Please Guide me..
-- modified at 0:48 Friday 27th April, 2007
Thanks & Regards
Kumaran
|
|
|
|
|
Hello All!
I am really stumped on this. So I have a server/client app, with SQL as a backend. The client program has it's forms come up by the server. That where I use the FileWatch process. Works pretty well, and fast. I creat a file from the server on server, the client flewatch see that file, and open up a form. A timer on the form closes after a few some time. The file the server creates, gets deleted. I'm sure this isn't the best way, but it works pretty well, except now. I can only run up to like six or seven at a time. Anyone of them will work, but not all at the same time. My server is created the files just fine, so the problem is with the client side. I don't get a warning or an error. The watch process just doesn't run.
So here is a sample of the code.
Declaring it, Public FggWatch As New FileSystemWatcher
I have this in my form load event. I also tried to put it in IntilizedComponet.
AddHandler FggWatch.Created, AddressOf FggWatch_Created<br />
FggWatch.Path = (TempFileSetting)<br />
FggWatch.Filter = "*.fgg"<br />
FggWatch.IncludeSubdirectories = False<br />
FggWatch.EnableRaisingEvents = True<br />
And then here is what happen after the file gets tagged
Private Sub FggWatch_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs)<br />
Dim frmFgg As New frmFggWn<br />
Sound.PlayWaveResource("ding.wav")<br />
frmFgg.ShowDialog()<br />
End Sub
It worked fine for weeks, then all of sudden! You know. Now keep in mind I have 13 of thees little gems, the only difrence in the file names, and a diffrent form get displayed.
Thanks!!
Rudy
|
|
|
|
|
Rudy I am a little vague on what you are trying to do but the filewatcher can become unstable over time. So first off do you run the application that is hosting the filewatcher as a windows application or as a service? Why are you running so many filewatchers?
|
|
|
|
|
Hi Kevin!
It's running as a windows application. Basicly I need the server to control the client software 90% of the time, at will. For example, when a button on the server is pressed, form 1 opens on the client. When button 2 on the server is pressed, a timer starts on the client. The user at the client has very little control.
I have tried .Net Remoting, but havent been very successful at it. I thought about creating events that stop and start the filewatches at certain times. Just haven't gone down that road yet.
Why would a filewatcher become unstable over time?
Thanks!
Rudy
|
|
|
|
|
Most of my experience with FileWatchers is in the services realm I just don't use them that much in windows applications so there may be differences. To be precise I believe the Filewatchers become unstable because of the code they are running in. The threading in the Filewatcher can cause other contention issues in the application particularly when you are running timers also.
I periodically recycle the services and this seems to solve the issue but that is not good design. I am more prone to running them inside of their own class now and tearing that down and re instantiating it periodically disposing of all resources. I also try to use as few filewatchers as possible and change where they are pointing in code so I have fewer moving parts to keep track of.
So far it has been pretty stable but this is in windows services not windows applications which should not be an issue but they are much less complicated. What I have done is 180 degrees from what you are doing so there are clear differences. I use logging quite a bit to track down issues with timers and filewatchers as well as the performance monitoring tools which has been helpful.
|
|
|
|
|
Thanks for the tips Kevin!!
Rudy
|
|
|
|
|
i convert a project of C# to Vb.net, then in vb.net one warning messege appear in following line
Imports System.Management
warning is:::
Warning 1 Namespace or type specified in the Imports 'System.Management' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
as well as some of its component giving error ,like
ManagementObjectSearcher
Error 2 Type 'ManagementObjectSearcher' is not defined. <br />
etc...
someone know the cause\solution....????
|
|
|
|
|
You must add a reference to the System.Management namespace in VB.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|