|
Could you explain it for me?
Plz reply me...
|
|
|
|
|
The filename is passed as an argument to your program. Just get the arguments, and you'll have the filename. Then you can open the file or whatever else.
|
|
|
|
|
Shell("notepad.exe c:\Your File.txt", AppWinStyle.NormalFocus)
Does that help?
Normally you would have to specify the full path and file name of the application to open, but because in this case notepad is in the windows folder, you can just use "notepad" and the path in the code above is the file to open
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
Thanks Lloyd Atkinson for your suggestion but it is not a proper answer for me.
I want to open a text file by right clicking on it,choosing 'open with' option,and selecting my program.
I want to open text file as 'open with' my program instead of executing my program and then opening texe file.
Plz help me...
|
|
|
|
|
Hi Friends,
In these days i am in a problem because i have to store MS Word file into SQL Database's Table and i am using VB.NET 2005. So anybody here who can help me.
Thanx
Naresh Rajput
|
|
|
|
|
There are a lot of examples out there. Here[^] is one such example. A search will return a lot more.
|
|
|
|
|
Hi
Thanx for reply but dear it saves Image into sql instead of MS Word file
Thanx
|
|
|
|
|
There's no difference between the two. Either way, the file is just a stream of binary data. The technique is identical.
|
|
|
|
|
This sounds simple but I am unable to get it to work.
The function is passed a dataset, SQL Connection String and a table name. It is supposed to replace the contents of the table with the dataset. Why does this not work?
Public Function UpdateSQLTable(ByVal myConnection As String, ByVal mySelectQuery As String, ByVal myTableName As String, ByVal myDataSet As DataSet) As DataSet
Dim myConn As New SqlConnection(myConnection)
Dim myDataAdapter As New SqlDataAdapter
myDataAdapter.SelectCommand = New SqlCommand(mySelectQuery, myConn)
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(myDataAdapter)
myConn.Open()
Dim ds As DataSet = New DataSet
Dim myRecordCount As Integer = myDataAdapter.Fill(ds, myTableName)
ds.Clear()
ds.Merge(myDataSet)
Try
cb.DataAdapter.Update(ds, myTableName)
Console.Write("Updating DataSet succeeded!")
Catch e As Exception
Console.Write(e.ToString())
Return Nothing
End Try
myConn.Close()
End Function
|
|
|
|
|
Had a look at it and threw the hands in the air - bloody MS wizards why can't you people use stored procedures and understand the sql you are using instead of relying on wizards.
Probably because you use merge on the data set and it confuses the wizard (someone at MS probably didn't think it would be useful)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
ok, then if i do loaddatarow then would it work
|
|
|
|
|
As I said, I never use the wizards but why don't you see if it creates the script BEFORE you merge the datasets (not on the empty one - the original myDataSet).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Standard Question #1: What's the message, exactly?
|
|
|
|
|
Can i get entire datatable to be updated by adding new rows directly and not column values that way i can merge tables and update database
|
|
|
|
|
Yes. You can insert rows into the database without getting the rows and merging new rows into it, then writing the whole thing back to the database.
|
|
|
|
|
That is the question How? I used merge and loaddatarow method and then commandbuilder method to update but it did not worked.
|
|
|
|
|
If all this method is doing is writing changed data back to the database, why are you getting a set of records using an SQL, only to replace some of those records and write the whole thing back to the database. This is very inefficient.
Skip this step entirely and just write the dataset your passing into this function to the database. From what I've read in the code, there is no reason at all to retrieve a new dataset first and merge the passed in set into it.
Now, onto why the commandbuilder fails. If the SQL statement does not return the primary key of a table, it will fail. If you pass in an SQL statement that does joins, it will fail. CommandBuilder will only work with SQL that returns a single, keyed, non-joined table.
|
|
|
|
|
When i use crystal report then i can use a image in crystal report at design time but i want that a image which display in crystal report at runtime from ms access database?
Anshul Soni
|
|
|
|
|
Hi Guys,
I have something to ask if someone knows how can I open the file that i choose from the filelistbox? Every time I select a file in the filelistbox, nothing happens it will not open.
This is my code.
<br />
Dim a As String<br />
a= Shell("rundll32.exe url.dll,FileProtocolHandler " & FileListBox1.SelectedItem)<br />
Pls guys, I need you help on this one.
Thank you!
annir
|
|
|
|
|
Hello Annir,
Have a look at the given web link which provides similar information.
http://www.developerfusion.co.uk/show/278/
I hope this will assist you.
Regards,
Allen Smith
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Use System.Diagnostics.Process.Start() .
|
|
|
|
|
Question is pretty straight forward. Is it possible to check for x32 vs x64 processors in vb6?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
|
Score! Exactly what I was looking for. I figured it would be yet another call into Kernel32, but was unaware of how to do it.
Thanks!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi all,
I am using visual basic express 2008
1. How do I hardcode 2 ddns servers in vb.net? Or should i hardcode? can dns.gethostentry(dim host as string) resolve my domain without me specifying which dns server use to resolve?
2. I could not run my code successfully, below is the code.
Imports System.Net
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim host As IPHostEntry
Dim hostname As String = textbox1.text
host = Dns.GetHostEntry(hostname)
Dim fqdnAddress As String = host.AddressList(0).ToString()
TextBox2.Text = fqdnAddress
Catch ex As Exception
MsgBox("Unknown error")
Finally
End Try
End Sub
End Class
modified on Wednesday, September 10, 2008 2:55 PM
|
|
|
|