|
In the crystal report designer when you are creating a new parameter possibly there is a CheckBox which says "Allow Multiple Values" .Did u check that??
Tirtha
Do not go where the path may lead, go instead where there is no path and leave a trail.
Author: Ralph Waldo Emerson (1803-82), American writer, philosopher, poet, essayist
|
|
|
|
|
Yes, I already checked it. When I sent the first parameter, I used this code:
rpt.ParameterFields.GetItemByName("text").AddCurrentValue ("a")
Now I want to send the second one with the same code above, it seems to replace the first one like here:
rpt.ParameterFields.GetItemByName("text").AddCurrentValue ("b")
The result is
"b"
Which I want
a
b
Help me please.............
|
|
|
|
|
I don't use CR, but it would seem that you have to send the "a" and "b" parameters as an array. I have no idea if this will work or do what you want, but this is what I would try:
rpt.ParametersFields.GetItemByName("text").AddCurrentValue(New String() {"a", "b"})
|
|
|
|
|
Just 2 questions that are related.
I have a datagridview control and I would like to have it check every minute or so for the xml file it uses and see if there are any new entries. I am kinds of new VB.net (I have been using MS Access with VBA a while though).
1. I am not sure how to make a timer function that waits for 1 min and checks for updated info. A date/time stamp is part of the XML file so if there are new elements added i can tell by querying for anything past the last date time in the dategridview. I guess really im asking if I should just use the basic system.windows.forms.timer and should I make it a asynchronous thing? Never made something like this that keeps running in the background.
2. Is there a way to manage the XML file so it is not locked when I read it for this timer function? Im not really worried about 5 or 6 clients reading it every min but id be nice to say I have it managed if there are 200 clients. I am currently just using XmlDocument and the .load to read it. If there is a new record to be added im pretty sure that the xml file will need to be locked using (Using) or .lock?
Well thats more than 2 questions and I appreciate your help and this is a great site.
|
|
|
|
|
What are you doing with this? It sounds like a poor-mans version of a database. XML is most certainly NOT suited for acting like a database.
|
|
|
|
|
Yea a poor-mans DB is a good discription.
Its military - a log of radio traffic, instead of writing a log with a pen/paper.
The problem is one user creates a new log for his radio net. A new xml file is started and eveyone else who opens that file has no owner permission so the interface changes so they cant edit the xml file. So 1 guy is beside a radio and about 10 others want to view that log to see whats happening. We currently use mIRC chat but is not prefered. So I have used a xml file to give the guys who want to see what going on a actual file to open. Im not sure how i can do that with a DB?
|
|
|
|
|
This is how I would do it. There is a server that exposes a remotable component that manages the database. This includes creating new logs and notifying all the clients of changes to the logs.
This component would keep track of all the clients connected to it. When one of the clients tells this component to create a new log, the entry is created in the database, then a notification event gets raised with all the clients. The clients can then get the update from the component. The same would also be true for any updates to any log.
You could use a FileSystemWatcher to watch the folder where the XML files are stored, but there are problems with this. The FSW can only "see" changes to the file sizes depending on the O/S file system update interval. Just because a change is written to a file does NOT mean that the files Last Modified time gets updated when the change is made. There can be as much as a two minute delay before the FWS sees this change, depending on the server file system, of course.
|
|
|
|
|
Yea the more I mess with these xml files the more I realize I should just have a DB. So when you refer to "a remotable component that manages the database" you mean a VB interface to add/edit the logs?
How can the "clients" connect to the DB - a connection string to the SQL DB? and once they have connected is there events in the DB for when it get updated? (I am not going to be able to have a full version of MS SQL but I know they offer a express version for free).
It would be nice to just have 1 vb interface everyone installs with a connection path to the DB and I can resolve ownership so i can restrict who can add/edit.
Thanks - this helps a lot to clarify - so many things to look at this weekend
|
|
|
|
|
commieJerk wrote: So when you refer to "a remotable component that manages the database" you mean a VB interface to add/edit the logs?
Something like that. Try wrapping your brain around this[^], then Google for "VB.NET CAO remoting singleton" for some more docs and examples. Basically, you're writing a server that your clients will connect to and the server connects to the database. Your clients will never see the database itself.
|
|
|
|
|
Hi all.
I'm making a program in VB 2005 express edition and now i wanna make a picture appear for some seconds and then disappear. how can i do that?
thks in advance.
|
|
|
|
|
Put your picture on a form and display the form as per normal, using a timer event to close the form after the prescribed number of seconds.
---------------------------------------------------------
Damian - Wondering what to write here...
|
|
|
|
|
The easiest way is to add a picture box and then add a timer to hide it again.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok, i was thinking the same, but the problem is, i dont knwo how to work with it..
|
|
|
|
|
I recommend buying a book on VB.NET if you don't know how to use timers or controls.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
but could you give me an exemple on how to set up a timer?
for exemple: open an image, and after 5 seconds close it..
|
|
|
|
|
Timer timer = new Timer();
timer.Interval = 5000;
timer.Tick += delegate { myPictureBox.Visible = false; timer.Stop(); };
timer.Start();
This will hide myPictureBox in 5 seconds.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Up until now, I've always used a single form along with it's vb code(Form1.vb & Design). I now have a project where two forms are needed. I added a second form so now I also have (Form2.vb & Design). I want to access the 2nd form from a button on the 1st form and visa versa like a hierarchical menu system. Is it necessary to have a parent and child form relationship if I only want one of the forms accessed at any given time? Both forms will have independent vb code, but I will need to use a value created on form one in form two's vb code. I was going to hide each form that is not in focus at the time. What is the best approach for something like this?
MSH
|
|
|
|
|
MARKSHAM wrote: Is it necessary to have a parent and child form relationship if I only want one of the forms accessed at any given time?
No, the sensible thing to do here is to design both forms as user controls, put them on the one form, and switch which one is visible, at the press of a button.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for the suggestion. I'm new to VB and OOP so I'm going to have to look up user controls. Thanks again for leading me in the right direction.
MSH
|
|
|
|
|
Hi all,
I would be really thankful to you all if I could help me to slove my the following problem.
I've written following code to tokenize my string in VB.NET which use " " i.e space as delimiters.
Dim data(100,100) as string
Dim value As String = "&&&&&&&&&&&&&& Tech&&&&&&&&&Repu &&&& blic.com" # Input string where & is a space. I used & as space while posting message since space was ignored while posting message
Dim pattern As String = " " # delimiters
sites = value.Split(pattern)
k = 0
For Each s In sites
If s <> pattern Then
data(0, k) = s
outFile.WriteLine(data(0, k))
k = k + 1
Else
MessageBox.Show(" Space found")
End If
Next s
According to my understanding, the program should ignore the space and assign
data(0,0)=Tech
data(0,1)=Repu
data(0,2)=blic.com
But unfortunately, else part of code is never executed and some spaces are stored on dataarray along with the string.
Can anybody help me to achieve me my goal or any other advise for me?
My Goal is to assign:
data(0,0)=Tech
data(0,1)=Repu
data(0,2)=blic.com
hsprasain
|
|
|
|
|
Because your using spaces as your delimiter it was probably hard to notice but the values that will be contained in 'sites' are not spaces, they are empty strings. Take a look at this code:
Dim value As String = "A,,B,C"
For Each s As String In value.Split(","c)
Console.WriteLine(s)
Next
You'll notice the values returned by the split function are 'A','','B','C' where '' is an empty string. It doesn't return the delimiter. In your loop you should test that the string is not empty.
|
|
|
|
|
Thanks a lot friend!!! I appreciate your help. It works well now.
|
|
|
|
|
Also you could use a regular expression to do the splitting. It will allow you to remove all the white space between values so you only get the actual text. Take a look at this.
Dim value As String = "A B C"
Dim regex As New System.Text.RegularExpressions.Regex("\s+")
For Each s As String In regex.Split(value)
Console.WriteLine(s)
Next
|
|
|
|
|
Hey,
I'm creating a program that can control my media player.
My keyboard has special buttons like play, pause, next, previous and they work with every program.
How can I do this in vb.net?
Greets,
Stijn Janssen
|
|
|
|
|
The same way you would hanld e any other keypress on your form. Enable the KeyPreview property on your form, then in the form's KeyDown event, check for the appropriate key. You can find the list of Keys in the docs for the Keys Enumeration[^] docs.
|
|
|
|