|
I wrote a document management windows system. I am storing documents into the SQL server database (such as images, word docs, excel etc). The user then can brows what is in the database. I have a listview control which displays the documents that is stored. I want to be able to have the user view the documents. I have the fallowing code
Dim myProcess As System.Diagnostics.Process = New System.Diagnostics.Process
Dim urlString, aspx_string As String
aspx_string = "GetDocument.aspx?id=" & m_data.ID & "&version=" & m_data.VersionNumber
If (System.Configuration.ConfigurationSettings.AppSettings("WebsiteBaseURL").Length > 0) Then
urlString = System.Configuration.ConfigurationSettings.AppSettings("WebsiteBaseURL") & aspx_string
myProcess.StartInfo.FileName = urlString
myProcess.StartInfo.WindowStyle = _
System.Diagnostics.ProcessWindowStyle.Normal
myProcess.Start()
Else
MsgBox("Can't Open the document")
End If
I am able to display the any kind of document, but the problem is that the browser gives "Action canceled" error then it opens the document with the appropriate application program. Any ideas how I could get around this problem.
|
|
|
|
|
Hello.
I need to create a function to enumerate (list) all controls and respective values existing in a form.
Any ideas?
Thanks
Wilson
|
|
|
|
|
Not such an easy task. Controls can contain child controls. And "Value" is not so easily defined because for something like a ListBox with multiple selections you would have a collection of selected values.
You start by enumerating each control in the form Controls collection. This will give you a list of all "first generation" controls on the form. But that will not always list all controls, because if a GroupBox (Panel, other container control) exists, the Form.Controls collection will not include the container's child controls. So you would then have to enumerate the GroupBox Controls collection to get it's children. But then a GroupBox could also contain a child GroupBox, and on and on ad infinitum.
An interesting exercise in recursion ...
Robert
|
|
|
|
|
Hi, I am recently looking for a validation function for Canadian Postal Codes in VB .net environment. The validation will make sure the postal code is a valide post office postal code. And if some elements of the address like province, city name, street name are provided will
perform some kind of lookup to make sure the Postal code in the address is valid.
Anybody knows where I can get hold of the source code or any reference object that prvides this kind of function? Thanks.
Shirley Lu
|
|
|
|
|
You might want to search for a web service that does this instead. Because this information can and does change. The code is not that hard, it's the database behind it holdling all that information that's the problem.
I Googled for "canada postal code verification software" and came up with lots of hits...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Shirley
Your question is quite generic.Whenever we have to validate a Character or numeric data.It should match with already existing values or we have to validate it with some set of rules.In the priror case you need to maintain a database with valid information.If you already have a database then its good,what you got to do is just write a function which will do comparison queries on the input information.
Hope this Helps
Mandar Patankar
Microsoft Certified professional
|
|
|
|
|
I have a table that I'm storing the actual names of classes in as a string. from the selected record I'd like to be able to instantiate a class from the string in the table. I've found examples using createobject(), but in all those cases the class had to be registered first. I have a couple of classes and would like to be able to just use the string stored in the table instead of a select statement so that when new classes are added, I don't have to change the code. does anyone know how to do this?
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
You need reflection to accomplish this:
System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("FullyQualifiedTypeName")
Note that you need the Assembly instance in which the class which should be created resides. If this is not the executing assembly than you will have to use some of the other static functions of Assembly .
|
|
|
|
|
|
In that case, no.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello all ....
I want to open a file in its parent application In visual basic 6...i dont want to specify the exe path of the application...based on the file extension my application should search its parent application and open the file...
In visual basic 6
Using Shell i tried... Like
Shell("d:\windows\system32\notepad.exe d:\temp.txt" )
but in this i need to give the parent application path.i dont want to do that...
in
In Vb .net we have
process.start(d:\temp.txt)
this opens in the parent application...
i want to do the same thing in Visual Basic 6....
Can any one help me out...
Thanks in advance....
|
|
|
|
|
Did you try:
Shell("D:\temp.txt")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i tried
shell("d:\temp.txt")
it gives invalid procedure call error msg
|
|
|
|
|
I seem to remember why that didn't work now. Try:
Shell "CMD /C D:\TEMP.TXT"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, was wondering if anyone has ever tryed to implement a right click action on a MenuItem, ie: like the start menu does, u right click an item and it shows another Cmenu... i notice that when my appz context menu is popped up, u can press the windows button and nothing happens, ie: only one cmenu at a time, but then i realized that if the start menu is a Cmenu then it cant inherit from a system menu (which i believe MenuItem does). So anyone know of a completely rewritten menu control? or another way to go about this.
(BTW it appears that a MEnuItem doesnt send windows messages to a nativewindow, ie u cant subclass it.)
like this
<br />
Class MenuItemSubClass<br />
Inherits NativeWindow<br />
Sub WndProc(m as Message)<br />
MessageBox.Show m.msg.tostring<br />
'nevers shows a single message<br />
End Sub<br />
End Class<br />
<br />
'Usage<br />
Sub Form_Load<br />
dim mis as new MenuItemSubClass<br />
mis.assignhandle(aMenuItem.Handle)<br />
End Sub<br />
ANY IDEAS??? (also drag n drop would be cool )
|
|
|
|
|
Hi Friends,
I m using stored procedure to create dataset & bind that 2 my grid control. For that I have writeen the following logic. Kindly let me know that is this the correct way or is there any other optimised & good way of creating & binding a dataset 2 a particular control.
Dim cmdDetail As New SqlCommand("usp_Contact_Select_ContactDetail", ObjConContacts)
Dim daDetail As New SqlDataAdapter
Dim dsDetail As New DataSet
Dim drDetail As SqlDataReader
'
With cmdDetail
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@EntryType", SqlDbType.TinyInt).Value = EntryType
.Parameters.Add("@FilterCriteria", SqlDbType.Text, 100).Value = IIf(IsNothing(Trim(txtFilterCriteria.Text)), "", Trim(txtFilterCriteria.Text))
End With
'
With daDetail
.SelectCommand = cmdDetail
.Fill(dsDetail)
grdContactDetails.SetDataBinding(dsDetail, "")
End With
Can we directly bind a DataReader to any control??
Friends just let me know ur thoughts / suggestions regading optimization of my above code.
Regards,
Vipul Mehta
Regards,
Vipul Mehta
Software Engineer
Chenoa Information & Software Services Pvt Ltd
|
|
|
|
|
l=RemoveMenu(menu,pos,MF_DISABLED)
menu- handle to menu
pos- Position of menu
The above code is not working
|
|
|
|
|
Hi
I have a Button(for example) and I want to check how many click eventhandlers have been assigened tothis Button
how can I do it?
-----
suppose that I have a Button , I want to assign an eventhandler for its click event, only if it has no eventhandler. how can I do it?
|
|
|
|
|
I've got a huge headache right now (side-effect of being at work!), so I could be wrong here, but I don't think there is a way for you to do that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
Tanx,
what is the usage of Me.Events?
Can't it help me?
|
|
|
|
|
Nope. It's a Protected, ReadOnly property that returns an EventHandlerList object. The EventHandlerList has no enumeration capabilities since it is not a true collection.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am looking for a good website to learn Vb.net Any good suggestions?
I have prorgrammed in Java swing. How long would u think it would take a person to be a intermediate vb.net programmer
Thanks in advance
ep
Imagine a Day when the Concept of money disappears.
|
|
|
|
|
I don't know of any websites that offer complete tutorials. A better bet would be to exvaluate your own skill set against what you find at a book store. And for how long that will take? Only you can answeer that question.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
G'day and thanx in advance for anyone replying to my question.
Being a VB.Net newbie, I am having trouble using basic text extraction from a richtextbox.
As the user types into a richtext box I have a tool tip that pops up when the user hits '(' and closes on the ')' key hits. It appears just below and to the right of the current caret location in the richtextbox.
I would like to be able to extract the last word typed just prior to hitting the '(' key, so I know what they are trying to do and can provide appropriate tips in the tooltip.
Can anyone help me with a short example of extracting text from the current caret position - 1, to the last '$', " " , "<", ";" entered before the current caret position.
Sorry if it's a real Newb question, .NET has so many bloody classes, I'm sure there's a simple way to do it, but I don't know where to look.
Cheers, Craig.
|
|
|
|
|
The current Caret position is always stored in the SelectionStart property of the RichTextBox control.
Now, the Text() property will return the text as a String object. You can then use its LastIndexOfAny(char(), startIndex, count) method, using 1 for startIndex and the value of SelectionStart for the count, to find the index of the last character, which you've already supplied in your post. This will give to the starting position and ending position of the word your looking for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|