|
i want to move the text in status bar at the time of form loading
|
|
|
|
|
Just put your code in the FormLoad procedure.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
You could also use a timer and a label to move the text, though you might need a picturebox either side of the label as it is a container and will hide the label as it is moved across. Basically timer1_tick() labelStuff.left -= 1, with some checking for the maximum area it can go to. If you want to have it continuously scrolling (not just start again once finished), you'll need at least 2 labels, and it gets a bit trickier.
Cheers,
Daniel
|
|
|
|
|
Is it possible to create a file dialog which allows browsing of a remote pc instead of local? If so, please provide some help links or advice.
I am trying to write an application which will browse the directories of a remote pc.
Thx in Adv.
Yoshimitsu
|
|
|
|
|
If you are talking about a local network, then you can just share the folders you want to browse.
if you are talking about any computer on the internet, then you will have to create a server/client application, install the server on the remote computer, and the server will have to provide a protocol-like api for the client (you computer) to consume, including folder browsing requests.
|
|
|
|
|
CodingYoshi wrote: Is it possible to create a file dialog which allows browsing of a remote pc instead of local? If so, please provide some help links or advice.
I've not tried it, but I'd imagine you'd be able to get or set a UNC path on the dialog.
|
|
|
|
|
Hi Colin,
Can you provide me with some more information about UNC or any links you know of?
Thanks b4 hand
Yoshimitsu
|
|
|
|
|
UNC is basically this:
\\ServerName\ShareName\DirectoryName\FileName.ext
|
|
|
|
|
I know how to create create folders in vb.net but i am not sure if it is possible for me to created a password protected folder so as to hide information inside that folder from the user.
The folder is going to be used for storing signitures..so i need to protect it. does any one know how to do this..
please help.
|
|
|
|
|
Windows does not support this. You can password protect a zip, but not a folder. You can make a folder hidden, but that's easily side stepped by someone who wants to. So are zip passwords, actually. Your best bet is to encrypt your data in some way. A comon way is to store an MD5 hash, and not the password itself, although MD5 is not so secure, nowadays.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thanks my friend. so would it be wise to store the signiture of the person in the database, sql2000 so that a typical user wouldn't have access to these individual signiture..
that is, in stead of storing the path, i store the actual picture..
|
|
|
|
|
Oh, you'r estoring a bitmap ? In that case, yes, I'd store it in the DB, if it's sensitive. The file system won't let you stop anyone accessing those files.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I am trying to get the dates to insert correctly in a MySQL db. All of the date columns keep being inserted as 0000-00-00 instead of the date that suppose to be inserted. I was told to use a parameterized query which I am not quite familiar with but I tried some code but still did not work. Can someone look over my code and see what I am doing wrong as far as creating a parameterized query?
Here is some code that I tried but the dates are still being displayed as 0000-00-00 in db:
Dim myConnString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=192.168.1.27;" & _
"DATABASE=testship;" & _
"USER=;" & _
"PASSWORD=;" & _
"OPTION=3;"
Dim MyConnection As New Odbc.OdbcConnection(myConnString)
MyConnection.Open()
Dim MyCommand As New Odbc.OdbcCommand
MyCommand.Connection = MyConnection
MyCommand.CommandText = "INSERT INTO ls_orderitems (OrderDate, OrderCustomer, OrderAcctNum, OrderType, OrderSoNum, OrderItemPartNum, OrderItemPartDesc, OrderItemQty, OrderItemQtyRec, OrderItemQtyDtRec, OrderItemBO, OrderItemBODt,OrderItemCanceled, OrderItemCanceledDt, OrderItemNotes, OrderItemPONum, OrderItemRetailPrice, OrderItemSalePrice, Status, InsertDate) VALUES ('" & OrderDate & "','" & OrderCustomer & "','" & OrderAcctNum & "','" & OrderType & "','" & OrderSoNum & "','" & OrderItemPartNum & "','" & OrderItemPartDesc & "','" & OrderItemQty & "','" & OrderItemQtyRec & "','" & OrderItemQtyDtRec & "','" & OrderItemBO & "','" & OrderItemBODt & "','" & OrderItemCanceled & "','" & OrderItemCanceledDt & "','" & OrderItemNotes & "','" & OrderItemPONum & "','" & OrderItemRetailPrice & "','" & OrderItemSalePrice & "','" & Status & "','" & InsertDate & "'" & ")"
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderDate", OrderDate))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderCustomer", OrderCustomer))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderAcctNum", OrderAcctNum))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderType", OrderType))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderSoNum", OrderSoNum))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemPartNum", OrderItemPartNum))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemPartDesc", OrderItemPartDesc))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemQty", OrderItemQty))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemQtyRec", OrderItemQtyRec))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemQtyDtRec", OrderItemQtyDtRec))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemBO", OrderItemBO))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemBODt", OrderItemBODt))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemCanceled", OrderItemCanceled))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemCanceledDt", OrderItemCanceledDt))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemNotes", OrderItemNotes))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemPONum", OrderItemPONum))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemRetailPrice", OrderItemRetailPrice))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("OrderItemSalePrice", OrderItemSalePrice))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("Status", Status))
MyCommand.Parameters.Add(New Odbc.OdbcParameter("InsertDate", InsertDate))
MyCommand.ExecuteNonQuery()
MyConnection.Close()
|
|
|
|
|
OK. First, you're SQL is wrong. It's not written to accept parameters. You're still just building a string that represents an SQL statement and not doing it correctly. You have single and double quote marks interchanged and are probably violating how certain fields should be passed in. The way it's coded now, it looks like your passing in ALL of your values as strings, and that's not going to work. It should be something like this (at least in MS TSQL, I don't know how MySQL denotes a parameter):
MyCommand.CommandText = "INSERT INTO ls_orderitems (OrderDate, OrderCustomer, OrderAcctNum, " & _
"OrderType, OrderSoNum, OrderItemPartNum, OrderItemPartDesc, OrderItemQty, OrderItemQtyRec, " & _
"OrderItemQtyDtRec, OrderItemBO, OrderItemBODt,OrderItemCanceled, OrderItemCanceledDt, " & _
"OrderItemNotes, OrderItemPONum, OrderItemRetailPrice, OrderItemSalePrice, Status, InsertDate) " & _
"VALUES (@OrderDate, @OrderCustomer, @OrderAcctNum, @OrderType, @OrderSoNum, @OrderItemPartNum, " & _
"@OrderItemPartDesc, @OrderItemQty, @OrderItemQtyRec, @OrderItemQtyDtRec, @OrderItemBO, " & _
"@OrderItemBODt, @OrderItemCanceled, @OrderItemCanceledDt, @OrderItemNotes, @OrderItemPONum, " & _
"@OrderItemRetailPrice, @OrderItemSalePrice, @Status, @InsertDate)"
See all the "@" in front of the names? This tells TSQL that this is a named parameter. I have no idea if this is going to work with MySQL. I've never used MySQL.
Now, on to you're parameter objects. You've managed to create the parameters, but you did not tell each parameter what database type it is, preferrably maching the type you gave that column in the database. This is what is going to give the OdbcParameter object the information it needs to convert your data into something that the database is going to understand, like your dates. These example won't be accurate because I have no idea how you defined your columns in the database table:
MyCommand.Parameters.Add(New Odbc.OdbcParameter("@OrderDate", OdbcType.Date)).Value = OrderDate
MyCommand.Parameters.Add(New Odbc.OdbcParameter("@OrderCustomer", OdbcType.Int)).Value = OrderCustomer
MyCommand.Parameters.Add(New Odbc.OdbcParameter("@OrderAcctNum", OdbcType.Int)).Value = OrderAcctNum
.
.
.
Seriously, pickup a book on MySQL and learn to write and execute SQL statements by hand, before you try and get your code to do it for you. If you don't understand how the SQL works, it's impossible to write the code to do it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I'm new to vb.net, i was working on a college project, its just like a notepad.
similar to notepad, now i want to save a file as html file and i don't know how to do it. can any one help me.
Thanks in advance.
|
|
|
|
|
To save a file as html, just add the html extension to the file name. An html file is just a regular text file. Make sure that the encoding you use for the file is the same as specified in the html code.
What is it that you are going to write to the file? Do you have the html code, or do you have a text that you want to turn into html code?
---
Year happy = new Year(2007);
|
|
|
|
|
|
Does anyone know how to create a listview like the one used in Outlook 2003/2007 with expandable levels.
|
|
|
|
|
This is all I could find: Outlook Bar and Outlook Style Sidebar.
They're both in C# though.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Thanks for that but I was thinking about the listview on the right hand side of the screen in outlook - Inbox.
|
|
|
|
|
I don't use Outlook, so I'm not exactly sure what you are talking about. But I think it's just a regular ListView.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Can you add collapsable levels to a standard listview?
|
|
|
|
|
Sorry, that would be a TreeView. Like I said, I don't use Outlook so I wasn't sure what you were talking about.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
I currently over do the redudancy checks in my code such as If Not IsNothing(variable) AndAlso If Not IsDBNull(variable) Then and I am wondering when and where the various types of "Nothing" occur.
When a value is sent to the database does it see "Nothing" as "NULL"?
When a value is returned from the DB does the code see "DBNull" as "Nothing" or "Null"?
Just curious, I dont want to type more than I have to.
Cleako
|
|
|
|
|
a db knows nothing about 'nothing' it knows only about 'null'
if are reading from a db you only need to check 'isdbnull' which is a function that checks if the value equals 'null'
|
|
|
|
|