|
Yeah, I can't understand your question either.
|
|
|
|
|
=D I have problem more important to me
how get data from diferent list? and diferent group..
please help me......
|
|
|
|
|
I'm trying to create an application that utilizes one button to record the start and end time. If the user clicks it once the app records the current time as the start of the function. If it is clicked again the end time of a function is recorded. The name on the button preferrably would change from start to end. I'm looking into trying this due to a limitation on the number of buttons allowed on a school project.
Thanks
|
|
|
|
|
DateTime.Now will give you the time right now. You can store this and subtract it from the current time the second time the button is pressed. The button has a Text property you can use to change what text is on it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have an existed Excel file (My_Excel.xls) with pure data, when I try to open it as database ... following SQL define requires a table name (what_table?) in order to access it:
<br />
conn = "Provider= Microsoft.Jet.OLEDB.4.0; Data Source=" & Environment.CurrentDirectory & "\My_Excel.xls; Extended Properties=Excel 8.0;"<br />
<br />
Dim SQLString As String = "SELECT * FROM what_table"<br />
<br />
DBCon = New OleDbConnection(conn)<br />
DBDat = New OleDbDataAdapter(SQLString, DBCon)<br />
DBCom = New OleDbCommandBuilder(DBDat)<br />
DatT = New DataTable<br />
<br />
DBCon.Open()<br />
DBDat.Fill(DatT)<br />
DBCon.Close()<br />
How can I define My_Excel.xls the table "what_table" in order to use the above code?
Thanks to any help
|
|
|
|
|
Define a named range in your spreadsheet called what_table that represents the data area you want to access.
Paul Marfleet
|
|
|
|
|
It is working.
Thanks
|
|
|
|
|
Good stuff.
Paul Marfleet
|
|
|
|
|
I have been struggling with this issue off and on for the last couple of weeks. I created a .NET project with a class that will be available to .NET and then another .NET project with a COM class that will make that first class available to VB6. I am not letting Visual Studio register the object for COM and am doing that myself. I am using the following commands to register the assembly.
gacutil /i TestCode.dll /f<br />
regasm TestCode.dll /tlb:TestCode.tlb /codebase
I am able to see the assembly in the references box in VB6 and I can use the intellisense but it wont let me use it. I have tried the following 2 ways to instantiate the object.
Dim objTestCode As New TestCode.Testing
and
Dim objTestCode As TestCode.Testing <br />
Set objTestCode = New TestCode.Testing
Neither of those allow me to use the code. At one time I was able to use the assembly but that was last Friday and it was when Visual Studio was doing the registering for me. The reason I am manually registering it on my own box is that I want to replicate what will occur when this is deployed to multiple servers.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Howdy, Cleako,
I think I may be up against a similar problem. It sounds as if we're both aiming for the same goal.
What failure do you get when you say that "it won't let me use it" ??
I posted the following question yesterday as well on a different forum within this site.
--Chris
---------------------------------------------------------------------
Howdy,
I am an RF engineer (read: non-programmer!) building a library of GPIB-instruments that I can use from various applications (.NET C#, Excel VB6) to script a few tests. This article has been *extremely* useful, although now I'm stuck at one error in Excel VB6 I can't resolve:
"File or assembly name instrument_drivers, or one of its dependencies, was not found"
What does seem to be working correctly:
- My dll, "instrument_drivers", shows up in the list of VB6 references
- I can 'Dim x As instrument_drivers.HP8648C' in my code (and the intellisense does recognize all of the class subroutines that I've made public,
- I can 'Set x = New instrument_drivers.HP8648C', again with confirmation of intellisense,
- I can 'x.open_device(23)', one of the subroutines
But, I get the above error when I go to run it. Google searches churn up similar problems from other programmers, notably opening permissions in a windows temp directory and disabling file indexing. All done, no luck.
Any ideas or comments are greatly appreciated,
--Chris
|
|
|
|
|
I ended up not using the gacutil /i part and just used the regasm part but it became a 2 line command.
regasm TestCode.dll /codebase<br />
regasm TestCode.dll /tlb:TestCode.tlb
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
I was having the same problem. the /codebase switch made it work. Thanks!
|
|
|
|
|
Curious. How are you adding the COM Guids to your assembly?? When I need to create a COM component in VB.NET, this[^] is the template I follow.
|
|
|
|
|
I used this[^]. The class worked great and I am still confused why they say I must use
Regasm AssemblyName.dll /tlb: FileName.tlb /codebase
and not
Regasm AssemblyName.dll /codebase<br />
Regasm AssemblyName.dll /tlb: FileName.tlb /codebase .
I may be totally wrong but the only thing that worked for me was that 2nd way which I found here, partially[^] but I ended up having to use the combination of the 2.
I was successful installing to the GAC but the combination of installing to the GAC and registering the assembly seemed to confuse the code.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
I'v created a crystal report with the 'mail label' expert and everything is working fine. But now I want to adjust the size of the label, but I can't seem to find where I can do this without remaking the report with the wizard.
Anyone know where this is located?
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Would like to find a simple tutorial that will use web services to return a simple number to start with client/server must be cross platform different language for instance VB.NET to Java but they must consume the same XML or SOAP etc. I am a beginner and have tried several tutorials but they never seenm to be as you would like. They always have errors that i dont understand at present. Can you point me in the right direction been tring this for 10 days now with no success.
|
|
|
|
|
There's a walkthrough in the MSDN documentation that comes with Visual Studio. Open Visual Studio and hit F1. In the Documnet Explorer that comes up, click on the Index tab, then type "Web service, creating" into the "Look for" box.
|
|
|
|
|
Hi Dave
I know it is basic stuff but some time when you are looking on the web some people just put all the crap under the sun on it and just does not help thank you
|
|
|
|
|
im trying to make it to where i can browse for the ".txt" files and load them to a datagrid, and how to save ones that have been edited in the data grid.
if anyone can show me some code or link me to it
that would be great.
thanks
-Chris
|
|
|
|
|
What does one of these text file look like? What you do depends on the format of the text file. You cannot just load text into a datagridview. It has to be parsed into columns, probably put into a DataTable object, then you bind the grid to that datatable. Saving changes becomes a problem if the text file is not in the correct format.
|
|
|
|
|
Hello Chris,
I believe this code snippet should help you atleast to browse and load text files into the
datagrid.
Dim strFileName As String
Dim strFilePath As String
Dim sSlash As Single
Dim FileDialog As New OpenFileDialog
Try
With FileDialog
.Title = "Import Sage CSV file"
.InitialDirectory = "D:\Accounts"
.Filter = "Text Files | *.txt|All files|*.*"
.ShowDialog()
sSlash = InStrRev(.FileName, "\")
strFilePath = Mid(.FileName, 1, sSlash)
strFileName = Mid(.FileName, sSlash + 1, Len(.FileName))
End With
Dim strConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & strFilePath & ";" _
& "Extended Properties=""text;HDR=NO;FMT=Delimited"""
Dim conn As New OleDb.OleDbConnection(strConnectionString)
conn.Open() ' Open connection with the database.
Dim objCmdSelect As New OleDb.OleDbCommand("SELECT * FROM [" & strFileName & "]", conn) ' Create new OleDbCommand to return data from worksheet.
'Dim objCmdSelect As New OleDb.OleDbCommand("Select * from [Sheet1$]", conn) ' Create new OleDbCommand to return data from worksheet.
' Create new OleDbDataAdapter that is used to build a DataSet based on the preceding SQL SELECT statement.
Dim objAdapter1 As New OleDb.OleDbDataAdapter
objAdapter1.SelectCommand = objCmdSelect 'Pass the Select command to the adapter.
Dim objDataset1 As New DataSet 'Create new DataSet to hold information from the worksheet.
objAdapter1.Fill(objDataset1, "TextData") 'Fill the DataSet with the information from the file.
Me.DataGridView1.DataSource = objDataset1.Tables(0).DefaultView 'Build a table from the original data.
conn.Close() 'Clean up objects.
Catch ex As Exception
MsgBox(ex.Message).ToString()
End Try
I hope this helps.
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
hi there, i'm new to vb 2005.
i'm trying to move an image around the form, as usual, the image flicker.
i set the double buffer properties to true, but nothing shown.
my draw code as below:
Graphics.DrawImage(ball,X, Y, 50, 50)
thanks for it
|
|
|
|
|
You have to put your drawing code in the Paint event of your form. Anywhere else and you're pretty much wasting your time.
The form gets invalidated, meaning that it needs to repaint itself. There are several things that can cause a repaint, such as dragging another window acrossed your form, or calling the form's Invalidate method. This forces Windows to schedule a repaint of your form.
You might want to setup a Timer on your form, setting it for say 100 milliseconds (one tenth of a second). Handle it's Tick event, and in your handler, update the new position of your object, then call the form's Invalidate method.
|
|
|
|
|
thanks a lot Dave.
i did put in in the form_Paint, i'm trying to trigger the repaint event by a keydown event. i call invalidate inside the keydown event, but the graphic still flickered.
|
|
|
|
|
How did you set the double buffer and where did this code get put?? Also, what does the painting code look like?? What does the keydown code look like??
|
|
|
|