|
listview.items.add returns a listviewitem
a property within that object is "index" which will give you the position
'to set the row visible
listview.topitem = the returned listviewitem
|
|
|
|
|
I just want to ask a simple question and that is how to compare the queries of URLs that actually generates the same page for example:
http://www.example.com/?a=abc&b=cde
http://www.example.com/?b=cde&a=abc
Now these two URLs are equivalent but how can i compare them, i am actually using this code:
<br />
Dim i As Integer = 0<br />
i = Uri.Compare(uri1, uri2, UriComponents.Query, UriFormat.SafeUnescaped, StringComparison.InvariantCulture)
But it doesn't seem to work. Thanx in advance !!!
AliAmjad (MCP)
|
|
|
|
|
It doesn't work because they are actually two different URLs. By specifying the UriComponents.Query as the partsToCompare parameter, you're telling the function to compare the query strings of the two URLs, which are different. You should probably want to use UriComponents.Path instead to compare the URL upto (but not including) the query string.
|
|
|
|
|
This won't work because the querystring parameters are in a different order. The Compare method will be checking whether the query portions of the URIs are equivalent as strings, which they're not.
You would have to write your own comparison algorithm. This could be done by splitting each query into its constituent parts, storing those parts in a data structure and checking whether each data structure contains the same set of key/value pairs.
Paul Marfleet
|
|
|
|
|
Hi... I have 2 Questions 1.) I have a button which selects mp3 files and then stores their information into a datagrid and then records changes to the database. The problem is that if I look for files outside of the solution folder and select them to be added to the datagridview an error message appears saying that the database could not be found at the specified location(the location they give in the error isn't where the database is supposed to be located in the first place). It works when adding files within the solution folder and any underlying folders within the solution folder but just not outside of this folder. Any ideas why this could be?
My 2nd question is that I have various textboxes on a form that when the user selects a row in the datagridview and enters information into these textboxes then the datagridview should be updated. My textboxes are binded directly to the dataset tables columns and my datagridview to the dataset table. It was throwing a concurrency violation error earlier because i called datgridview.update() in the row leave event for the datagridview as well as a call to a sub called saveChanges which is a standard save procedure which checks if there are changes and updates database if there are. Now that I have removed the saveChanges() call from the rowLeave event for the datagridview..... the final row isn't saving changes. My datasets and table adapters are all generated so as far as I know this shoud all be fine? Can Anyone help? Its an access database by the way...my code works fine that I made to add files to the dataset and create a new row etc. Its just the editing that isn't working?
Mr Oizo
|
|
|
|
|
1. Sounds like you are defining the path to the database realtive to the working directory, which changes when you choose a file. Get the application path and use that to specify the path of the database.
2. Dunno.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi... I'm not too sure if I understand but I think you mean that my datbase location is not hard coded. I have it set as "dataSource=..\..\data\Accessdatabase.mdb" for the connection string datasource. the reason why i have done it like this is that i need to move my application around to various workstations while i am developing and I was taught that hard coding my connection string(aka using just the generated connection string) is bad practice? So if I am using a relative path and i choose to publish my software will it give me problems and will I only be able to select files from within the project solution folder to add to my datagridview?
Mr Oizo
|
|
|
|
|
Mr Oizo wrote: Hi... I'm not too sure if I understand but I think you mean that my datbase location is not hard coded.
No, it's because it's relative, so you rely on the working directory. The working directory is changed when you select a file.
As I said, get the application directory, and use that as a starting point to reach the database file.
---
single minded; short sighted; long gone;
|
|
|
|
|
HI ~
I'm currently doing my project about mail notification tool on the system tray(Gmail Checker).
My project should be able to check if some new mail is available now from the pop3 webmail server(Gmail). And I will coding in VB.2005.
But now,I still having some problems.And I don't know how to begin to write the project.
Could you please help me how to check the unread mail from pop3 server. Or can u send me some source code for coulult ?
Please help me. Thanks
Here my email address : edmond1002@gmail.com
Best regards,
Edmond
|
|
|
|
|
Hi,
I am beginner to vb.2003
I am working with CrystalReport in vb.2003. I have problem in passing the parameter value.
when I pass the date value from the form to CrystalReport i used this code.
Dim OB As New Receipts_monitoring
OB.SetParameterValue("Begindate", datetimepickerbegin.Value)
how i can pass the none date value to the CrystalReport.
(because i want to pass the value to the CrystalReport and sometimes i don't want to pass the value to CrystalReport)
please help me.
|
|
|
|
|
You could make the parameter optional
|
|
|
|
|
Hi
I made a report by crystall report and load it in vb.net 2005 . now i want change size of textbox in rpt file at runtime by vb.net. But i cannt.....
pleaze help me/
|
|
|
|
|
|
hello, can someone help me?
i trying to do a add to list coding
here the story, i try to do a toys ordering system. i want to implement a "add to list/cart" function into my systems. can i do that? if it is,whats the coding?
it is necessarily to connect the features from access?
|
|
|
|
|
Hey
You need to implement this at a kernel level to avoid any security restrictions, you could use assembler. I am assuming you are working on an x86 derivative which is a difficult instruction set to master as it is a CISC processor - Complex Instruction Set Computer so rather than learning it as it will take a long time it is probably better to learn PIC16F84 asm which is a RISC - Reduced Instruction Set Computer and then implementing an emulator to translate PIC16F84 into x86 asm.
If you google "PIC16f84 asm shopping cart implemented in and x86 with multithreading and article to do my homework"
I am sure you will find loads of results.
Dan
|
|
|
|
|
thanks for the reply.....
i really appreciate it
|
|
|
|
|
Well yes I did realise this however after hours of reading i discovered that x86b can actually cause a fracture in the space time continueum if not used correctly so judging by my assumed level of the posters question I deemed it necessary for him to use x86asm if the universe is to continue as is.
Thanks for your concern and maybe he can learn x86b next.
Dan
|
|
|
|
|
Oops my question got deleted - I think one of my gerbils stood on the delete key.
I use them to write my code for me as their random generation of code is much better than anything I can write.
For anyone else who is interested - I suggested using the x86b as the photvolteic capacitance of the transmogrification process from the algorithm is more stable - or something like that.
You always pass failure on the way to success.
|
|
|
|
|
Try reading the sticky post on top of the forum, that explains how to ask questions so that people can answer them.
For starters, add to cart implies ASP.NET, there's a forum for ASP.NET. If you ask in the VB forum, at least tell us it's ASP.NET.
newbie@vb wrote: if it is,whats the coding?
That's not a good question to ask. The articles on this site are here to give full code for things, the forums are for helping people with existing code.
newbie@vb wrote: it is necessarily to connect the features from access?
If you want to store your orders, then you'd have some database on the back end, yes.
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 )
|
|
|
|
|
Hi,
I have two forms, frm1 and frm2. If a specific event occurs, i want another form to be opened, and that frm1 passes the variable "Drive" on to frm2. How can i accomplish this?
Thanks in advance,
--Zaegra--
|
|
|
|
|
Public Sub frm1_Load(EventArgs e) Handles frm1.Load
Me.variable = frm2.Drive
End Sub
NOTE: make sure you add the "Drive variable" to frm2.
Good luck!
Code pre-built is code that you don't have to build later.
|
|
|
|
|
Hi Zaegra,
Best is to declare a property in the target form (frm2). You can then assign the property the value you want to pass on from the calling form (frm1):
Public Class frm1<br />
Dim DriveValue as String<br />
Public Property Drive() As String<br />
Get<br />
Return DriveValue<br />
End Get<br />
Set(ByVal Value As String)<br />
DriveValue = Value<br />
End Set<br />
End Property<br />
Private Sub frm1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
MsgBox(DriveValue.ToString)<br />
End Sub<br />
End Class<br />
<br />
Public Class frm2<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim frm As New frm1<br />
frm.Drive = "C:\"<br />
frm.Show()<br />
End Sub<br />
Dim <br />
End Class
or something like that...
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Sorry, but why doesn't this code sort my table by the variable DateValue?
ChartDataTable.Select("Datevalue > 0", "Datevalue")
ChartDataTable.AcceptChanges()
This code then prints the data in the unsorted order:
For Each dr As DataRow In ChartDataTable.Rows
Console.WriteLine(dr.Item("DateValue"))
Next
thanks
|
|
|
|
|
cstrader232 wrote: ChartDataTable.Select("Datevalue > 0", "Datevalue")
Because the Select method returns an array of DataRow object, which your code completly ignored. It does not make any changes to the existing DataTable.
You can get rid of the AcceptChanges line, it doesn't do anything here.
cstrader232 wrote: This code then prints the data in the unsorted order:
Like I said, you completely ignored, and dropped, the array of DataRow objects returned by the Select method. You're looking for something more like:
Dim sortedRows() As DataRow = ChartDataTable.Select("Datevalue > 0", "Datevalue DESC")
For Each dr As DataRow In sortedRows
Console.WriteLine(dr.Item("DateValue"))
Next
|
|
|
|
|
OK, sorry... but I would then think that you could put that row collection right back into the table it came out of.
Can you give me the best procedure for doing that?
This doesn't seem to work (input array longer than number of columns in the table):
Dim SortedRows() As DataRow = ChartDataTable.Select("DateValue > 0", "DateTimevalue")
ChartDataTable.Clear()
ChartDataTable.Rows.Add(SortedRows)
|
|
|
|