|
|
Do you need a component to open a word document in a new window?
How easy is it to do?
I have a list of radio buttons, and when i select one and hit the button, i want the document to appear in a new window.
Any help would be great, thanks!
|
|
|
|
|
Try System.Diagnostics.Process.Start("C:\MyWordDoc.doc") .
|
|
|
|
|
The answer you have gotton before is good but if you wanted to select a file and open that selected file..you could use this one also..
drag and drop a openfiledialog control to your form... and use the following code..
<big>If OpenFileDialog1.ShowDialog() = DialogResult.OK Then<br />
System.Diagnostics.Process.Start(OpenFileDialog1.FileName)<br />
End If</big>
using this method... opens any file that is selected in their own program...and also a new window..
Nab
|
|
|
|
|
|
How do you select a specific folder?
|
|
|
|
|
I have a record like this
Note : "-----" is for space.
-------------------------------------------------
Name----Date & Time-------------Status
--------------------------------------------------
Man1----1/15/2007 5:19:02 PM----Up
Man2----1/15/2007 5:19:02 PM----Down
Man3----1/16/2007 5:19:02 PM----Up
Man4----1/17/2007 5:19:02 PM----Down
Man5----1/14/2007 5:19:02 PM----Down
Man1----1/17/2007 5:19:02 PM----Up
Man2----1/17/2007 5:19:02 PM----Down
Man3----1/14/2007 5:19:02 PM----Down
Man4----1/17/2007 5:19:02 PM----Down
Man5----1/15/2007 5:19:02 PM----Down
----------------------------------------------------
I want to take a report like this
--------------------------------------------------------------
Date & Time------------Man1-----Man2----Man3----Man4----Man5
--------------------------------------------------------------
1/14/2007 5:19:02 PM----Up------Up------Up------Down----Down
1/15/2007 5:19:02 PM----Up------Down----Up------Up------Down
1/16/2007 5:19:02 PM----Up------Up------Up------Up------Up
1/17/2007 5:19:02 PM----Up------Down----Up------Down----Up
---------------------------------------------------------------
Plz help me
Thanks
Kumaran
|
|
|
|
|
Where are you struggling? What have you tried? How have you attempted to organize the data?
|
|
|
|
|
Looks like a school project.
You may want to consider collections, and hashtables?
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|
|
I need a script to get the name or path on a active window opened.This i need to run on a Pop-up Web page opened to display an Image.This image i have uploaded to this site. The Pop-up window does not include a Address to copy the path. I need a VBscript to automatically get the title so the i can put it in clip board.
Praveen
|
|
|
|
|
You can use FindWindow function within user32.dll. It will return window name and handle. I am not sure how to impliment it
|
|
|
|
|
The VB code below tries to get the Window title character for the First Active Window.
I have error Poping up on my screen when I run this.
Error "No Creatable Public Component detected"
" MSDN Collection Doesn't Exits"
What i need to do to get ride of this error?
Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" _
(ByVal hwnd As Long, lpdwprocessid As Long) As Long
Private Sub Command1_Click()
Dim tempHWin As Long
Dim StringDisplay As String
Dim CountOfBytes As Integer
Dim Buffer As String
Dim Instnace As Long
tempHWin = FindWindow(vbNullString, vbNullString)
Buffer = Space$(128)
CountOfBytes = GetWindowText(tempHWin, Buffer, Len(Buffer))
Instance = ProcIDFromWnd(tempHWin)
StringDisplay = StringDisplay & Left$(Buffer, CountOfBytes) & tempHWin & Instance
Text1 = StringDisplay
End Sub
Function ProcIDFromWnd(ByVal hwnd As Long) As Long
Dim idProc As Long
' Get PID for this HWnd
GetWindowThreadProcessId hwnd, idProc
' Return PID
ProcIDFromWnd = idProc
End Function
Praveen
|
|
|
|
|
hallo,
i wnt any small ideal example of database connectivity (containing datagridview)
in vb.net(winforms) & mysql daatabase.
if anyone have any ideal example please give me.
---Priya
priya_p233@yahoomail.com
priya
|
|
|
|
|
If you google, there's a whole site out there dedicated to this.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
hi priya,
see this code I hope it will give some idea about mysql+ado.net using Vb.net
Dim connectionString As String = "Driver={MySQL};SERVER=localhost;DATABASE=NorthwindMySQL;"
Or you can use an ODBC DSN, as you can see from the following code that I've used TestDSN DSN to connect to the data source:
Dim conn As New OdbcConnection("DSN=TestDSN")
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim connectionString As String = "Driver={MySQL};SERVER=localhost;DATABASE=NorthwindMySQL;" '
Dim conn As New OdbcConnection(connectionString)
conn.Open()
Dim da As New OdbcDataAdapter("SELECT CustomerID, ContactName, ContactTitle FROM Customers", conn)
Dim ds As New DataSet("Cust")
da.Fill(ds, "Customers")
dataGrid1.DataSource = ds.DefaultViewManager
conn.Close()
End Sub
WINNING IS NOT OUR DREAM,IT'S A HABIT
HAVE A NICE EVENING
|
|
|
|
|
hi dornala,
Thank u so much for ur help.
i write as u given , i didnt get any error but data is not displayed in datagridview.
i put MsgBox(ds.Tables(0).Columns(0).ColumnName) it is showing columnName it means data is there is ds(dataset) but not seen on datagridview(DgvCustList)
will u give me wht to do plizzzz.....
Dim connectionString As String = "User Id=root; Password=root; Host=jupitor;port=3306;Database=timesheet;"
Dim conn As New MySqlConnection(connectionString)
conn.Open()
Dim da As New MySqlDataAdapter("SELECT custid,custcode,custname FROM cust_mast;", conn)
Dim ds As New DataSet("Cust")
da.Fill(ds, "cust_mast")
DgvCustList.DataSource = ds.DefaultViewManager
MsgBox(ds.Tables(0).Columns(0).ColumnName)
conn.Close()
-- modified at 8:33 Wednesday 17th January, 2007
-- modified at 8:34 Wednesday 17th January, 2007
priya
|
|
|
|
|
a DgvCustList.databind() should solve your issue.
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|
|
I am using VB.NET with Ms Access and Ms Excel, how can i diplay Table name or amount of sheets,
Socheat
................
|
|
|
|
|
Socheat,
MS Access is different from excel.
Excel Using OLE connection:
Public Class XcelFileReader
Const testStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source={0};" & _
"Extended Properties=""Excel8.0;HDR=No;IMEX=1"""
'NOTE: Imex =1 Reads all value as typeof(string)
Protected Sheets As ArrayList
Protected cCon As OleDbConnection
Public Sub New(ByVal file As String)
cCon = New OleDbConnection(String.Format(testStr, file))
Sheets = New ArrayList()
Try
cCon.Open()
System.Diagonstic.Debug.WriteLine(cCon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,Nothing).Rows.Count.Tostring())
Finally
If cCon.State <> System.Data.ConnectionState.Closed Then cCon.Close()
End Try
End Sub
End Class
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|
|
I have just upgraded a Visual Studio 2002 Windows application project to Visual Studio 2005, including upgrading to the latest custom controls.
The compiled application runs fine but on exit I get a windows message box with my application's title in the title bar and the message:
The exception unknown software exception (0xc0020001) occurred in the application at location 0x7c812a5b
This happens after the last line of code has run so as a total guess it's something to do with garbge collection.
Then I run in the Visual Studio 2005 environment I don't get this error (or any others).
The application uses Crystal Reports, Dundas, Devexpress and Infragistics controls.
My only lead so far is that if I get the application to display on screen one of the Crystal reports then the error doesn't happen on closedown. I'm looking through this code to see what I can see but there's quite a lot of code and I don't know what I'm looking for.
Any help welcome.
- Ben
|
|
|
|
|
I wrote a code in VB.NET which accesses the outlook folders.Following is the code.According to this code it displays outlook folders and there is hyperlink on each subject.I want when we click on the subject the message body should be dispalyed.in href how can we do this? I know we have to write a function to dispalay the body.but i don't know how to do this?can u please tell me ?
an exception Invalid cast exception is coming in this line
oMsg = oItems.Item(i)
it means when we access the folders and suppose the folder contains a calender meeting items i.e. another cast or datatype then the inner loop stops executing.
please tell me to handle this exception?
code is like this
we ahve to add a refernce Microsoft outlook 11.0 library from Project->add reference -> COM tab and the code is this please help me?
Imports System.Runtime.InteropServices
Imports
Microsoft.Office.Interop.Outlook
Imports
System.IO
Module
Module1
Sub Main()
'OlSecurityManager.DisableOOMWarnings = True
Try
' Create Outlook application.
Dim app As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application
' Get NameSpace and Logon.
Dim appNameSpace As Microsoft.Office.Interop.Outlook.NameSpace = app.GetNamespace("MAPI")
appNameSpace.Logon("Outlook", "bhavna123",
False, True)
' Get Messages collection of Inbox.
Dim fs As New FileStream("c:\Outlook_Folders.htm", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
Dim oPFolder As Microsoft.Office.Interop.Outlook.MAPIFolder = appNameSpace.Folders.GetFirst()
Dim oFol As Microsoft.Office.Interop.Outlook.Folders = oPFolder.Folders
Dim sfolder As Microsoft.Office.Interop.Outlook.MAPIFolder
Dim j As Integer
For j = 1 To oFol.Count
sfolder = oFol.Item(j)
s.WriteLine("")
s.WriteLine(sfolder.Name)
s.WriteLine("")
s.WriteLine("")
Dim oItems As Microsoft.Office.Interop.Outlook.Items = sfolder.Items
Dim oMsg As Microsoft.Office.Interop.Outlook.MailItem
Dim i As Integer
For i = 1 To oItems.Count
Try
oMsg = oItems.Item(i)
s.WriteLine("- ")
s.WriteLine("" + oMsg.Subject + "")
s.WriteLine(" ")
Catch ex As InvalidCastException
Console.WriteLine("Caught:InvalidCastException", ex)
'Ignore any invalid casts.
End Try
Next
s.WriteLine(" ")
s.WriteLine("")
Next
s.Close()
fs =
New FileStream("c:\Outlook_Folders.htm", FileMode.Open, FileAccess.Read)
Dim d As New StreamReader(fs)
d.BaseStream.Seek(0, SeekOrigin.Begin)
'LogOff
appNameSpace.Logoff()
'cleanup
app =
Nothing
appNameSpace =
Nothing
'oItems = Nothing
Console.ReadLine()
Catch exc As ApplicationException
Console.WriteLine("Caught:ApplicationException", exc)
'Finally
' OlSecurityManager.DisableOOMWarnings = False
End Try
End Sub
End
Module
|
|
|
|
|
Hi.
How do I search anything in datasets or datatables? Are there any methods for this?
WofR
|
|
|
|
|
By searching, I assume you are referring to searching records.
If so then,
Dataset - Cannot really search records in a collection of datatables!
Datatable - you can create a view out of it and apply a filter on it.
Shreekar
|
|
|
|
|
You can create a BindingSource if you haven't already and do the following:
MyBindingSource.Position = MyBindingSource.Find("Column Name",Key) Where key is the primary key value of the record you require.
This code will cause the BindingSource to jump to the specified method, if you don't want to jump, don't set the .Position property. The .Find property returns an index to the BindingSource's list.
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
Depending on what you are doing the DataSet.Select(string) function can be usefull. Where String is the where clause of a SQL Statement, AND not to terribly complicated.
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|