|
Worked out what is was - I actually needed to set the sort mode of each column to "Automatic" rather than "Programmatic". Seems the latter mode is really only for managing the sort glyphs etc. Now the SortCompare event fires but I have a new problem which is to get numeric columns such as "Race Number" to sort by the value (not the string value) then by the race start date (which is a DateTime column).
I was going to delete this post but thought I'd leave it there for anyone else that runs into the same problem.
Mike
|
|
|
|
|
hi all
i want to insert the value in field of type "time stamp" in sql server 2000 from vb.net application. that field is not null.
when i had tried to insert new record in a row of table leaving time stamp field empty but it insert value as <binary>. how to get time stamp and insert into sql server.
Tasleem Arif
|
|
|
|
|
MY dear, I have a table Product in Sql server with 2 fields Prod_id & Prod_Name, I want to populate the combo box with prod Name , & when I select the Prod Name from the list then I need Prod ID , how easily I can do it with the shortest cod.......... Help me please....
|
|
|
|
|
in vb.6 the format(date,"dd/mm/yyyy") if working
but in vb.net the format(today,"dd/mm/yyyy") is reflecting as 06/00/2006
the "mm" part is always gives the "00" what can i do
|
|
|
|
|
"mm" is for minutes. You need to use "MM" for months.
I also recommend that you use the Date.ToString() method instead of Format() which is only there for VB6 compatibility reasons.
Dim myDate As Date = Date.Now
Dim myString As String
myString = myDate.ToString("dd/MM/yyyy")
|
|
|
|
|
I have entered data into a database table, "PersonData". It has 5 columns
PersonNo Sex Age Married Education.
Now I want to write a validation program in vb whereby it opens the "PersonData" and then checks that if person is married, then the spouse has to be of different sex. and if the pesron is married then the age has to be more than 15. There are many incosistencies that I would like my code to check, but if I can be helped with this ones I can handle the others. This I want to run for say about a thousands records.
Then I write the validation messages to a text file.
This is a sample of the code I have written:
Option Explicit
Public objConn As ADODB.Connection
Public objRst As ADODB.Recordset
Public objPwd As ADODB.Recordset
Public objCmd As ADODB.Command
Public Sub main()
Set objConn = New ADODB.Connection
Set objRst = New ADODB.Recordset
Set objCmd = New ADODB.Command
objConn.Provider = "MSDASQL.1"
objConn.ConnectionString = "Password=pwdsa;Persist Security Info=True;User ID=idsa;Data Source=TESTING;Initial Catalog=TESTING"
objConn.Open
If objConn.State = adStateOpen Then
MsgBox "Connexion with the server established", vbInformation, "prjTesting"
Else
MsgBox "Connexion Failed !", vbInformation, "prjTesting"
End If
End Sub
Private Sub cmdValidate_Click()
Open "C:\Testing\testing.txt " For Output As #1
With objRst
Do While Not .EOF
if !married = 1 and !age < 15 then write #1, "PersonID: "; !personid & " " Person must be greater 15 years in order to be married"
.MoveNext
Loop
End With
End Sub
Private Sub Form_Load()
main
Set objRst = New ADODB.Recordset
objRst.Open "tblPersondata", objConn, adOpenDynamic, adLockOptimistic
End Sub
-----------------------------
The problem with my code is that, it only checks for the first column only as with the other columns it does not.
What am I doing wrong.
Quick Help is appreciated.
Thank you
phokojoe
|
|
|
|
|
I don't see in your code where married or age are getting set to values...
Mike Lasseter
|
|
|
|
|
Actually, What i am saying is that, the data is already in the database. Now the code I am writing will look for the inconsistencies and then write the message to the .txt file that I have specified with the ID of that particular person where there is incosistancies.
In this, below
Private Sub cmdValidate_Click()
Open "C:\test\persondata.txt " For Output As #1
With objRst
Do While Not .EOF
If !married = 1 and age < 15 Then Write #1, "Person ID: "; !personid & " Too young to get married"
.MoveNext
Loop
End With
End Sub
For the married code is 1 and I am checking that if that particular person is married then, his/her age must be greater than 15 otherwise write down the personid in the persondata.txt file so that it will be corrected. Since I will be checking many persons and the same time that is why I have enclosed the statement inside the DO WHILE NOT EOF.
Please help
phokojoe
|
|
|
|
|
Please help me with the above thread.
Help is urgently needed. Actual, I am writing a code to validate my survey results whichI have used MS sql server 2000 as the backend and VB as the front end. Or can anybody help me with which is the appropriate software to use to validate the dataset.
phokojoe
|
|
|
|
|
Dear..!
i want to read data from notepad(Includes phones number)
and fill all the data in listview ...so i need
1- brows and select file which found in C: directory
2- fill all the data inside the listview items
thanx alot for you....
kilany
|
|
|
|
|
You do realise that a "notepad file" is just a plain text file?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
is your problem solved .
if not send me message.
i can solve it.
rtytryt
|
|
|
|
|
hellow to all ..
i am generating a crystal report that have double rows that i would like to remove , let say i have
ID - NAME - ADDRESS
1 SSS SSSSS
1 EEE EEDEE
1 TER WEWEE
i would like to remove two rows , and keep one
have can i do this in crystal reports
thxx
|
|
|
|
|
Hi, I need to perform Shallow and Deep copies in my VB.NET application. Ive seen several code intensive methods to do this. Anyone know whay Microsoft has not just given a basic copy object command? Am I missing something?
In my application I have several User Controls and the user needs to cut and paste the controls to build up a screen of data that is then saved. The user often need to copy an existing instance of a user control and then modify it and save it. The amount of code I need to manually write seems intense.
Are there 3rd party extension to VB.NET that offer help in this area? As aI said b4 am I missing something?
I want to be able to do something like...
dim newObject as ucMyControl
newObject = new list.selecteditem
I know the keyword, NEW, is for new instances of classes but it would be handy if it created a new copy of a class as instanciated.
Cheers,
Kadi
|
|
|
|
|
You copy objects in .NET by "cloning" them. You can make your classes cloneable by implementing the ICloneable[^] interface.
A shallow copy is easy and can be done in 1 line. You just need to call the Object.MemberwiseClone()[^] method. All objects have this method.
Public Class Foo : Implements ICloneable
Public Function Clone() As Object Implements System.ICloneable.Clone
Return Me.MemberwiseClone
End Function
End Class
If you need to do a deep copy, then you need to explicitly create new objects within the above Clone() method and assign them to the clone's member variables.
|
|
|
|
|
Thanks for the reply. Do people manually do this for things like undo and redo? I have a control which has a defered update to a data collection class. If I want to undo the last change or x changes to the control do I manually code the undo? I had kinda hoped I could just pop it on a stack and pull it off again.
Kadi
|
|
|
|
|
I've never implemented undo/redo functionality before, but it sounds like you've got the right idea.
Before you change the state of an object, you should clone it and push it into the Undo stack. When the user does an Undo, you should pop the object out of the Undo stack and overwrite the current object with it. The only gotcha you have to worry about here is if there are any objects still referencing the Undone object. If this is the case, then you may need to hold the undo-able object in some kind of container class so that you don't have to update all of the references. In fact, the container class should probably implement the Undo functionality.
I found an article on CodeProject covering an undo/redo framework written in C#. Perhaps it might be of use to you.
http://www.codeproject.com/csharp/undoredobuffer.asp[^]
|
|
|
|
|
I want to select a picturebox control at runtime. Like in MS Word, If we insert any image, we can select it and perform operations on it (crop, rotate, resize, etc.).
I have created one user control in which I allow user to add imges (Placed in picture box of 100 X 100 size).
I could move the control at runtime by capturing Mouse related events. Now I want to resize it say by dragging the small sqares that should appear at its corners.
Can I use GDI+ to achieve this? Can anybody suggest me any code or APIs?
Thanks in advance...
Anil
|
|
|
|
|
Hi,
Im using VB 6.0.. I try to Print few words to the Zebra Label Printer..But doens't seems to print at all..
COde is :
Printer.Print "^XA"; Printer.Print "^MD10"
Printer.Print "^LH0,0^FS"
Printer.Print "^BY2,3.0^FO20,2^BCN,54,N,Y,N^FR^FDMirudhubashini^FS"
Printer.Print "^FO20,59^A0N,28,37^CI13^FR^FDWomens center^FS"
Printer.Print "^FO20,65^A0N,28,37^CI13^FR^FDCoimbatore^FS"
Printer.Print "^PQ1"
Printer.Print "^XZ"
Printer.EndDoc.
Either I see Status in Printer Queue as "Spooling".. and if i give Printer.Enddoc ..Nothing I can see in Printers Queue
All ^XA and similar words are for Label Printer ZPL Language
Pls help
-- modified at 6:01 Saturday 6th May, 2006
|
|
|
|
|
You are trying to send a control character but it is sending a literal string with an ^ in it.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hye All ,
I 'm facing a problem in changing the DSN file at run time , I ' m working on Crystal Report 8.5 , I ' ve a report which comes from a procedure , I 've 2 Year Wise SQL Database ,At Run Time User Selects the Year and my database connection gets change now I want to change the report DSN at run time so that I won't be needing to change all my Reports. I just want to change DSN File Values (User Id, Paddword,Server , database name )on run time , Can Anyone help me ?
Mannu
|
|
|
|
|
hi all
I want to disable Guest Account in WinXP in VB.can anyone tell me the API to use??
thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
-- modified at 5:07 Saturday 6th May, 2006
|
|
|
|
|
if there's one row in the datagrid. and i want the value of row(0) column(0)
using DataGrid1.Item(DataGrid1.CurrentRowIndex(), 0)
what i want here is to delete the current selected row.
it's working fine, unless the final row....
the error is : out of range
so what i can do.
Militiaware
Faris Madi
|
|
|
|
|
Code looks choppy there; shouldn't it be like this:
myDataSet.myTable.DefaultView(myDataGrid.CurrentRowIndex).Delete()
myDataSet.myTable.AcceptChanges
??? I wouldn't actually delete stuff from the grid as it is the underlying dataset you're trying to manipulate. Also make sure you apply "AcceptChanges" or the DS will not delete the record.
|
|
|
|
|
in other words...
i want to get the value of column(0) and row(i)
when i try this (column(0) row(0)), an exception occure "out of range"
Militiaware
Faris Madi
|
|
|
|