|
working on an algorithm that requires a sort in 2 ways.
1st i need to sort an array A - Z (the array.sort(myarray) works fine in this)
2nd i need to sort according to the length of the string in the array.
example
myarray() = {a,ab,aaa,abc,bad}
myarray sorted = {a,aaa,ab,abc,bad}
myfunction(myarray) 'what i want should be {a,ab,aaa,abc,bad}
|
|
|
|
|
I'm assuming your using VB.Net here.
You want to impliment an IComparer[^]
|
|
|
|
|
actually tried IComparer maybe i did it wrong. more research i suppose
|
|
|
|
|
iirc when implimenting an IComparer you just need to provide the logic for saying is one object is greater or less than another.
The sorting method then will just use it as part of it's functionality.
|
|
|
|
|
I would like to create the crystal report? How come visual basic express edition 2005 don't have the option to add crystal report under add new item? Any idea how to do it?
Regards,
SH
|
|
|
|
|
It should be there if you have selected General Envirnment.
To check the same go to Tools menu & change it to "General". I hope it will work.
|
|
|
|
|
cmd.CommandText = "select * from reglz where fatrname LIKE '%" & TextBox1.Text & "%' "
DataGridView1.Refresh()
ad.SelectCommand = cmd
ad.Fill(ds, "reglz")
DataGridView1.DataSource = ds.Tables("reglz")
this code for the table that called reglz
what i want to do is how can i make this sql statement on 2 tables together at the same time in a datagride
in other words i wanna see the 2 tables in the datagride with me condition that i have made in sql statement in reglz which is (where fatrname LIKE '%" & TextBox1.Text & "%' ")
then i want to save another word instead of the current one in database
and here my working code
Dim x As String
x = "'" & TextBox2.Text & "'"
Call conn()
cmd.CommandText = "update reglz set fatrname = " & x & " where fatrname LIKE '%" & TextBox1.Text & "%' "
DataGridView1.Refresh()
ad.SelectCommand = cmd
ad.Fill(ds, "dd")
DataGridView1.DataSource = ds.Tables("dd")
but how can i apply this code to the 2 table
SO what i want is :-
how can i select 2 tables to show them in a datagrid
how can i save any word for the two tables accroding to my condition .
plz help me
and thanks
|
|
|
|
|
Good morning MageDHV
i hope following code will help you. if you want to update,Insert,Delete, you have to Add relations to this Code, but this one Will Display you 2table. i Suggest you do one thing at a time, try Displaying results from 2tables and then display results based
Dim strconnection As String = "workstation id=5875-049;packet size=4096;user id=sde;Password=topology;data source=SGIICORNETGS01;persist security info=False;initial catalog=Tshwane_Valuations"
Dim cn As SqlConnection = New SqlConnection(strconnection)
cn.Open()
Dim cmdstr as String = "Select Property_Mass.boundary_Area, " _
" & Property_Mass.Actual_Extent, Property_Mass.Attrib_code, " _
" & Property_Mass.Lis_key, Property_Mass.Func_key, Property_Mass.Density, " _
" & Property_Mass.New_Net_Usable_Extent, Property_Mass.New_Total_Land_Factor, " _
" & Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1, Property_Mass.New_ADJ_Extent_2 , " _
" & Property_Mass.New_Points_2, Property_Mass.Fin_LS_Prediction, Property_Mass.Confidence_score , " _
" & Property_Mass.Flagtype, Property_Summary.Purchase_Date, Property_Summary.Purchase_Price " _
" & from Property_Mass, Property_Summary " _
" & where Property_Mass.Lis_key = Property_Summary.Lis_key "
Dim da As New SqlDataAdapter(cmdStr, cn)
Dim ds As New DataSet
da.Fill(ds)
Dim dv As New DataView(ds.Tables("Property_Mass"))
dgDetails.DataSource = dv
it will look Buggy, but i want you to get th Logic, you create a Join and test it if its working and apply it in your string variable and display it on your table, tell me if you were able to do that, and we will go to the search based on textbox input. that would be easy you will see.
Vuyiswa Maseko
|
|
|
|
|
Hi all,
Here i need to create a syntax tree to check the grammar of a string. The creating syntax tree should have our own created rules to check that string. Please help me to solve this issue.
Cheers,
Ajay
|
|
|
|
|
You start by going to Google and typing in "syntax tree". This brings up a bunch of results describing what a syntax tree is and most of them have coded implementations of said tree. It's up to you to write your own code using the understanding you have of the concept. We won't write it for you.
|
|
|
|
|
Hi Mr. Dave Kreskowiak,
Thanks for your kind response. Here i have to develop a tool to identify each and every element(firstName, LastName, BookTitle, etc..) in reference part of book(document). Then i need to tag differently the each element in accordance with their property.
Here my problem is to implement those properties into tree structure which will categorize each elements. For that i need a approach.....
Thanks,
Ajay
-- modified at 6:26 Wednesday 22nd August, 2007
|
|
|
|
|
anyone can help me? pls send me a time attendance with vb.net2003 using barcode scanner?
thank you!!
|
|
|
|
|
Two issues
1 - I'm not sure what you want
2 - you've mistaken this site for Rentacoder.
We help people solve their problems, we don't do people's projects for them.
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 )
|
|
|
|
|
If I have items in a list box like:
Apple
Banana
Carrot
How can I program the box to go to the selected item if I start typing into the drop down? For example, if I type A, I want Apple to appear then.
Thanks!
|
|
|
|
|
You can use foreach to step over the items in the listbox, then if you find one that matches ( using whatever rules you want ) then you can make an item selected. Something like
string searchString = tbSearch.Text.ToLower();
foreach(ListBoxItem item in lbItems.Items)
{
if (item.Text.Length >= searchString.Length)
{
if (item.Text.SubString(0, searchString.Length).ToLower() == searchString))
{
item.Selected = true;
break;
}
}
}
This code does not unselect the item selected before, but if the box is set to single select, that won't be an issue.
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 )
|
|
|
|
|
|
Launching a new VB dialect? Happens to me too!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
LOL - I wrote that without testing it, I suspect the semicolon will be the least of the issues with it. Hopefully it was close enough to push him in the right direction.
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 )
|
|
|
|
|
I was a little freaked by the code, but got the general idea of what you were trying to say.
Again I appreciate all the help. This is a great site to get ideas for things and how to do things.
|
|
|
|
|
Actually the easiest way to achive this is much simpler:
put this in the dropdown_textchanged event:
Me.ListBox1.SelectedIndex = ListBox1.FindString(Me.ComboBox1.Text)
|
|
|
|
|
Thanks. I'll try that.
I knew it had to be something I wasn't doing just right.
|
|
|
|
|
if statement using
A.Satheesh
|
|
|
|
|
Is this possible to scroll text in status bar?
Thanks In advance
Ejaz
|
|
|
|
|
There's no support for this built into the control, but you can add your own by creating your own version of the class.
|
|
|
|
|
hi iam new vb learner, i got a problem how to call function that return object it always said object variable not set but i think i already call it as object, is that in my code how to call object something wrong ?
--------------------------------------------
Public Function accessinfo() As Object
Dim myFSO, f As Object
Dim filename As String
On Error GoTo errhandler
filename = fillist.Path + "\" + fillist.filename
Set myFSO = CreateObject("Scripting.FileSystemObject")
Set f = myFSO.GetFile(filename)
txt_datecreated.Text = f.DateCreated
txt_dateaccess.Text = f.DateLastAccessed
txt_datemodified.Text = f.DateLastModified
txt_size.Text = (Format((f.Size / 1024) / 1, "##")) + " kilobyte "
Exit Function
accessinfo = f
errhandler:
MsgBox "No File selected !. Please select the file ", vbCritical, Warning
End Function
-------------------------------------------------------
and then i want to call function accessinfo in getinfo
Private Sub cmd_getinfo_Click()
Dim fso As Object
Set fso = accessinfo
MsgBox (fso.DateCreated)
End Sub
|
|
|
|