|
can somemone translate this MYSQL command to vb.net?
UPDATE `phpbb_config` SET `config_value` = 'NEW DATA' WHERE CONVERT( `config_name` USING utf8 ) = 'newest_username' LIMIT 1 ;
i need to change the "NEW DATA" part.
this is the string i have but it doenst work :
myCommand.CommandText = "UPDATE phpbb_config SET config_value = ?user WHERE CONVERT( config_name USING utf8 ) = newest_username LIMIT 1"
myCommand.Parameters.AddWithValue("?user", username.Text)
cheers
oh and the table looks like this.
database == phpbb , table == phpbb_config , colum ==config_value,,config_name,,is_dynamic
so is the config_name value i want to change, in the 3 colums exists something like 30 records, 4example -
Config_name ---- Config_value --- is_dynamic
activesessions 0 0
record_onlineusers 36 1
newest_username newuser 1 ---->>>> this is the one i want to change
im repeating myself because im stuck. lol
please help
hope someone understand this. lol
|
|
|
|
|
LegionFX wrote: newest_username
Shouldn't this be in quotes ?
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 )
|
|
|
|
|
the entire string is messed up... oh man... im so dead...
|
|
|
|
|
i didn't understand what u want but i have write a code for storing listbox elements to array one by one.
Try this code.
Dim arr(10) As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With ListBox1
.Items.Add("1")
.Items.Add("2")
.Items.Add("3")
.Items.Add("4")
End With
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Me.Close()
Dim i As Integer = 0
Dim n As Integer = 0
Dim ss As String
n = ListBox1.Items.Count
Try
Do While i <= n - 1
arr(i) = ListBox1.Items.Item(i)
i = i + 1
Loop
i = 0
Do While i <= n - 1
MsgBox(arr(i))
i = i + 1
Loop
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
With Regards...
Sanjay K
|
|
|
|
|
Thnx but i want that the listbox items are not displayed in the message box but the text which user will enter against each item in the textbox.hope u get my point.
|
|
|
|
|
Is it possible to sent two parameters to the same field in Crystal Report?
I have sent a parameter to a field in the report. Now I want to send the other one to the same field, but it replaces the first one. What I want is to send many parameters to show on the report. Is it possible to do that?
|
|
|
|
|
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
|
|
|
|