|
Dim conn As New SqlConnection
conn.ConnectionString = Session("ConnectionString").ToString
Dim cmd As New SqlCommand
cmd.Connection = conn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "dbo.yourProc"
Dim Prm1 As New SqlParameter("yourParam", SqlDbType.Int)
Prm1.Direction = ParameterDirection.InputOutput
cmd.Parameters.Add(Prm1)
Prm1.Value = Your Value
conn.Open()
cmd.ExecuteNonQuery()
conn.Dispose()
cmd.Dispose()
"People who never make mistakes, never do anything."
My Blog
|
|
|
|
|
Hi there,
Sorry .... I did not explain it properly. Now me try to explain. The above sample I posted is my stored procedure. Now this SP is on my machine. I send this to my client. My client will use SQL Query Analyzer to first run this script that will create this stored procedure in SQL Server. Now what I need is that my client should not use SQL Query Analyzer to "create" this SP. We want to load this script in text file and then create this SP through .NET. Is there any way to create SQL Query Analyzer object in .NET and run this?
Regards,
Vilas
|
|
|
|
|
|
I am trying to populate a combobox from a dataset/tableadapter. Is this possible?
Thanks
Brad
|
|
|
|
|
|
Hi All,
I have an interesting problem. I have a form with a DriveListBox control on it. I have a subroutine that is suppose to list the folders on the selected drive. The subroutine is from the Visual Basic help.
Subroutine:
Sub ShowFolderList(strPath As String)
Dim fs As Object
Dim f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(strPath)
Set fc = f.SubFolders
For Each f1 In fc
s = s & f1.Name
s = s & vbCrLf
Next
MsgBox s, , "ShowFolderList"
End Sub
The purpose of this subroutine is to list the folders for the designated path. So if I enter “C:” I should get a list of the folders listed in the C: drive. But when I input C: for the drive I get these values coming into the ShowFolderList subroutine.
Drive = C:
? strPath
c:
? f
C:\Program Files\Microsoft Visual Studio\VB
Why is it showing the above path when I selected only C:?
But when I select a different drive I get this:
Drive = F:
? strPath
f:
? f
F:\
This one will list all the folders in the F: drive, because the F: has a backslash on it. While the C: didn’t. But when I select the C: drive again I get the same thing with the C drive as I have previously shown, but if I concatenate a “\” onto the Drive1.Drive call it will work like it should.
All this brings up the question why do I need to concatenate a backslash onto a C drive call to return the folders, but I don’t have to concatenate one on any other drive?
Thank you,
Quecumber256
|
|
|
|
|
Quecumber256 wrote: But when I select the C: drive again I get the same thing with the C drive as I have previously shown, but if I concatenate a “\” onto the Drive1.Drive call it will work like it should.
Because you're not specifying a complete path when you enter "C:". Since you didn't specify the root directory, "C:\", the rest of the path will be built using the current directory, in your case, C:\Program Files\Microsoft...
It works for the other drives because the current directory on those drives is the root, "F:\".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
Its strange because all the DriveListBox does is show the drive letter. By default it should start at the root directory and work it way down.
Thank you,
Quecumber256
|
|
|
|
|
Yes, it returns a drive letter, but it returns a string representing ONLY the drive letter, not a complete path. It's your responsbility to do any fixup of this string so there is no ambiguity when you pass it to whatever function your calling.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want to create a onscreen keyboard that will depict all the functionalites ofthe actual working keyboard.I tried to perform the task by creating the control array of buttons.but however the keys are notworking for caps lock,shift,etc.I have to also change the language to some other instead of english if the related button is clicked.I want the entire source code for the on screen key board operation.Please help me its urgent for me as I have to return the project within five days.
rajan manoj
maxim software solutions
Kerala
|
|
|
|
|
You would be reinventing the wheel - there is an on-screen keyboard utility that comes with windows .. look in Accessories -> Accessibility.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hi,
I recently started using winsock in VB6 and found it to be a nifty 'little' control.
Now I'm trying to do the same in VB .Net and found it to be a problem.
I'm not very experienced in .Net.
I'm trying to read the state of my winsock control.
In VB 6 I simply used:
if myWinsock.state <> sckConnected then
myWinsock.connect
end if
This same code in .Net tells me I cant use .state in an expression because it's a TYPE.
So I had a look in the library and found that there are two winsock classes:
AxMSWinsockLib
and
MSWinsockLib
With the bottom one I can read the state of my socket but everytime I add a socket to the form, VB adds a AxMSWinsock instead of a normal winsock, how can I tell VB that I don't want an AxMSWinsock?
|
|
|
|
|
|
Thanx, thats EXACTLY what i wanted!
|
|
|
|
|
VB.Net/MS Access. I have made an application in vb.net, access. I need to provide this application to different users. I have installed the application on a different machine on the network. Can I deploy the MS Access database one machine and use the application on different machines. What is the path that needs to be set if such a case has to be implemented.
With Best Regards,
Mayur
|
|
|
|
|
Sounds to me that you want the database to reside in one location as it should.
Your application needs to point to that database. Meaning that the connection string
needs to point to that location. Use your app config/reg entry/xml doc what ever to specify where the database is located.
|
|
|
|
|
Hi all ..
I'm printing some images through PrintDocument.
I need to get the height in millimeters or centimeters before I send it to document. Is there any way of doing this? I have searched through graphics namesspace and only found ways om doing string measurements.
Pleae help
Regards // H
|
|
|
|
|
|
Hello Friends,
I'm working in VB.Net and want to develop a like media player can anyone suggest me how i can do it in Vb.Net.plz
Reagards
Raj Sharma
|
|
|
|
|
|
Hi, I am working on a web parts custom control which consists of a label,a list box and a context menu. I bounded the context menu to the list box such that when the user rightclicks on the list, the menu will appear. However, when the menu appears, it is blocked by the listbox. Hence only part of the menu is visible. How do I make the menu to be totally visible and to appear 'on top of' the listbox?
A code snippet is below:
list1.ID = "List1" 'List's ID
listitem1.Text = "Testing" 'List's items
listitem2.Text = "Event"
list1.Items.Add(listitem1)
list1.Items.Add(listitem2)
Me.Controls.Add(label1) 'Add the list as part of the custom ctrl
menu1.ID = "ContextMenu1"
menuitem1.Text = "Acknowledge" 'Menu Items
menuitem2.Text = "Testing"
menu1.ContextMenuItems.Add(menuitem1)
menu1.ContextMenuItems.Add(menuitem2)
menu1.BoundControls.Add(list1) 'Attatch menu to the list
Me.Controls.Add(menu1) 'Add the menu to the custom control
The code is in Visual Basic 05. Advice will be appreciated!
|
|
|
|
|
Hi Guys....
i want to show MS Chart in PrintPreview Control & then print it.
How can i do this???Please Help.
Thanks for ur suggestions in advance.....
|
|
|
|
|
Are we talking about VB6 here?
If so, then a really easy method would be to call the PrintForm method. But this means no print preview.
Otherwise, you're going to have to implement something much more complicated. The MS Chart control itself doesn't provide a nice way to print or save it. A lot of people copy the chart image to the clipboard and then print/save it, but that's bad practice.
|
|
|
|
|
Hello again.
I just dug up some of my old VB6 MS Chart code. You can get an image of your MS Chart control by taking a screenshot of your form. You can then use this image in your print preview.
Taking a screenshot of your form involves calls to the Win32 API. Luckily, Microsoft has already written a VB6 Module that will do the work for you. You'll probably want to call its CaptureForm() function.
http://support.microsoft.com/kb/q161299[^]
|
|
|
|
|
Hi Guys!
need some help
i want to change the color of rows in datagridview if the value of 1 column is say "Disabled". i m fetching data from sql server 2005 in dataset and binding the dataset with the grid.
Can any one help me in guiding me how to do it.. any hints.
i m using VS.NET 2005
abhinav
|
|
|
|