|
|
VB does NOT use nor interpret any part of an SQL statement. All that state is to VB is just another String.
|
|
|
|
|
How to autodetect a CD/DVD in my CD/DVD Room?
|
|
|
|
|
Hello Cpianism ,
Every Operating System Have services for detection of Hardware the second form you can says they are drivers.
When you insert any device like (USB,CD,DVD) then the driver retrives notificaton.
Best Regard
AnubhavaIf you can think then I Can.
|
|
|
|
|
I need it by code. I need to write a program that copy the CD content once it detect it in the CD room. If you need anymore questions please do ask me.
|
|
|
|
|
|
Thanks, I will take a look at it now
|
|
|
|
|
Hi,
I use this code for generating the data from Grid to Excel
Dim fs As New FileStream("D:\Library.xls", FileMode.Create)
Dim reportDataAdapter As IReportDataAdapter = New DataGridViewReportDataAdapter(datagrid)
Dim winFormsReportExporter As IReportExporter = New WinFormsReportExporter(reportDataAdapter)
Dim xlsFiledata As MemoryStream = winFormsReportExporter.ExportToXls
xlsFiledata.WriteTo(fs)
fs.Close()
xlsFiledata.Close()
But I get error message "An error occured during local report processing" near the line 4. Can any one help in solving the problem.
Regards,
JohnRegards,
John.L.Ponratnam
modified on Monday, February 22, 2010 2:07 AM
|
|
|
|
|
Dim LoExcel As Microsoft.Office.Interop.Excel._Application,Dtb102 As New DataTable,MyExlFl as String
LoExcel = New Microsoft.Office.Interop.Excel.Application
Dim oSheet As Microsoft.Office.Interop.Excel.Worksheet
LoExcel = CreateObject("Excel.Application")
LoExcel.Workbooks.Add()
oBook = LoExcel.ActiveWorkbook
oSheet = LoExcel.ActiveWorkbook.ActiveSheet
LoExcel.Cells.Select()
LoExcel.ReferenceStyle = Microsoft.Office.Interop.Excel.XlReferenceStyle.xlR1C1
LoExcel.DisplayAlerts = False
oSheet.Cells(1, 1).value = "Project : " + Trim(Dtb102.Rows(0).Item("proj_city").ToString)
blah.....blah....blah...
MyExlFl = Drctry101 + "\Comparision_To_MPR_" + TextBox1.Text + ".xls"
Try
oBook.SaveAs(MyExlFl)
Catch ex As Exception
System.IO.Directory.CreateDirectory(Drctry101)
oBook.SaveAs(MyExlFl)
End Try
LoExcel.WindowState = Microsoft.Office.Interop.Excel.XlWindowState.xlMaximized
'oBook.PrintPreview(True)
LoExcel.Visible = True
LoExcel.ActiveWorkbook.PrintPreview()
LoExcel.Quit()
|
|
|
|
|
Hello,
Is there a way where upon clicking a button, i can execute a code from a textfile, and if it find certain character (for example ':') in the textfile, it will pause the execution. And i can resume back the execution where it left by click the same button again?
Please help. Thanks.
|
|
|
|
|
Your question doesn't make sense. Are you saying that you want to run user-written code out of a text file? What are you ultimately trying to do with this?
|
|
|
|
|
Hi Dave,
Currently my program will import a textfile (like an script) and display it first on the GUI. This textfile has a list of smartcard commmands. See example below. Right now, it will treat '/' as comment and do nothing, otherwise, it will execute those commands.
I have a problem where on certain line, say line 00aa000000, i need to get out from the code and do something on my GUI manually. And i can resume back the operation (maybe i can click the same button?) starting at the line after the 00aa000000.
example of imported text file:
//this is an example of smartcard command
0011000000
0022000000
0033000000
//get out from code after this line below
00aa000000
//need to resume starting from here
0044000000
0055000000
//end of command
I am really2 new in this VB programming but know this is possible. Maybe you could help me a little bit?
- xiah -
|
|
|
|
|
The proper way to do this would be to move the processing of the file to a background thread, freeing up the UI to handle button clicks and UI updates. Google "BackgroundWorker class" and you'll find plenty of examples. Though, threading is NOT a beginners subject.
|
|
|
|
|
I will start searching for more info. Thanks Dave!
|
|
|
|
|
Hi,
starting from Microsoft example I have wrote a very little clase to write into the eventlog.
Public Class frmEventWrite
Public Function WriteToEventLog(ByVal Entry As String, _
ByVal AppName As String, _
ByVal EventType As EventLogEntryType, _
ByVal LogName As String) As Boolean
' Create the source, if it does not already exist.
If Not EventLog.SourceExists(AppName) Then
EventLog.CreateEventSource(AppName, LogName)
End If
' Create an EventLog instance and assign its source.
Dim myLog As New EventLog()
myLog.Source = AppName
' Write an informational entry to the event log.
myLog.WriteEntry(Entry, EventType)
Try
Return True
Catch Ex As Exception
Return False
End Try
End Function
Everything works BUT, I can't change the EventID, can be possibile it?
I mean change for example the numerber inside the EventiID, to insert numbers like 1042, etc. and not always 0.
Thanks.
|
|
|
|
|
Guizzardi wrote: I mean change for example the numerber inside the EventiID, to insert numbers like 1042, etc. and not always 0.
Because the code you posted doesn't write an eventID. Use one of the other WriteEntry method overloads that takes an Int32 (Integer) and you can provide an EventId.
|
|
|
|
|
I just installed Windows 7, SQL and VS 2005 and all the many many service packs and updates. One item that is annoying now that I'm starting to use the system is when I go to open a config file, html file, project, etc by right clicking and selecting "Open with..." Visual Studio 2005, VS will open, but the file will not be loaded.
Is this a compatibility problem? Has anyone encountered this same issue and is there a resolution?
Suggestions welcome Lost in the vast sea of .NET
|
|
|
|
|
No, it's not a compatibility problem. It's a problem with Visual Studio. Try running a repair on it from the Programs and Features control panel.
|
|
|
|
|
Hi CP ,
I am using
My.Computer.Keyboard.CtrlKeyDown in a code , if from keyboard Ctrl key + A is done then My.Computer.Keyboard.CtrlKeyDown - True & i am doing some function.
Working Fine.
Suppose if from Edit Menu - Select All then how can i project
My.Computer.Keyboard.CtrlKeyDown -- (have to be True) due to its False i am not getting the functionality.
Regards,For1206
|
|
|
|
|
I don't think anyone here has any clue what you're talking about.
Show the code you're using and we might be able to figure out what you're talking about.
|
|
|
|
|
This is not the way to link menu items with keyboard shortcuts, as far as I know. In C++ projects it's done by settings in the resource script, and I guess there must be something similar in VB. Maybe properties of the menu item.
btw I've changed the subject line in the hope that one of the VB experts who know the answer, will spot this.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Are you talking about the MenuItem.Shortcut[^] property?? You don't have to use My.Computer.Keyboard.anything to use this property.
|
|
|
|
|
You can register you Key to as a HOT KEY. then you can use it. If you can think then I Can.
|
|
|
|
|
Thanks for reply ,
suppose from keyboard i pressed CTRL + A then i am doing functionality to select the controls on the panel by checking
IF My.Computer.Keyboard.CtrlKeyDown then
-- some functionality
End If
CTRL + A --- SelectAll in EDIT MENU in menubar
This menu item is clicked then how can i forcefully
IF My.Computer.Keyboard.CtrlKeyDown then its in false but how to make true
-- some functionality
End If
-- the condition is linked with this one .
regards,For1206
|
|
|
|
|
I believe you're saying My.Computer.Keyboard.CtrlKeyDown is not reflecting the Control key state during a Click event.
I was not able to confirm this behaviour: that is the CtrlKeyDown reflected the state of the Control key for me using both MenuItem and ToolStripMenuItem.
Regards,
Mark Hurd, B.Sc.(Ma.) (Hons.)
|
|
|
|