|
Think i've solved the problem. Found an example in a book I have. I've used the following code and everything now seems to work. Hopefully all should be ok now. Thanks for all your help Dave.
'First change the directory of the database to the application folder
'[Change dbconnection to application startup path]
Try
Me.OleDbConnection1.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Path.Combine(Application.StartupPath, "Asset Control.mdb")
Catch eConnection As System.Exception
MessageBox.Show(eConnection.Message)
End Try
'[Change dbconnection to application startup path/]
Dim myRpt As Object
Dim cr_dataset As New dsAssetTypeReport
myRpt = New CRAssetsByAssetType1
Me.OleDbDataAdapter1.Fill(cr_dataset)
myRpt.setdatasource(cr_dataset)
Me.CrystalReportViewer1.ReportSource = myRpt
|
|
|
|
|
Hi,
I'm looking for some code that can calculate the Decibel from a mic.
Thx
|
|
|
|
|
Bascially, you can't. The driver set doesn't expose the functionality of mapping digital microphone values to an audio decibel level. The volume control of the microphone input jack, as well as any on the microphone itself, doesn't allow a mapping of real-world audio volume to digital values. If the outside sound is, say, 100Db and the sound card microphone volume control is set very low, the values you get as input from the microphone will be very low, resulting in an incorrect decibel calculation.
What would be required is a calibration so you can map the values from the microphone to a known range of volume in the outside world. This would mean that the volume control(s) would have to be set at a specified level and never moved. Also, you would need a source of known calibrated audio. Once you have these you can use the input from the calibration source to sample and map the values from the microphone and calculate decibels.
There is no function you can call to return the decibel information for you. You have to write it, but a large part of what you want is dependant on the audio you use for calibration. Without the calibration, all of your calculations will be meaningless.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a form which is having two combo boxes.
This two combo boxes contains the same list. This list is retrieved from the database. First, I am filling the first combo box and then i am filling the second combo box. This is taking more time.
Is there any method which I can fill the second combo box with the first one?
Please Help me...
Thanx,
Ravi.
|
|
|
|
|
The easiest way to do it would be to copy the items, one at a time, from one combobox to the other.
Dim index As Integer
ComboBox2.Items.Clear()
For Index = 0 To ComboBox1.Items.Count() - 1
ComboBox2.Items.Add( ComboBox1.Items(Index) )
Next
Or you could bind the Items collection of one Combobox to the other.
ComboBox2.DataBindings.Add(New _
Binding("Items", ComboBox1.Items, "")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try using the CopyTo method of the first combobox to copy its contents to an array then use the AddRange method of the second combobox to copy the array.
|
|
|
|
|
There is no other method in VB6
|
|
|
|
|
You didn't say you were using VB6 before. Is there some reason you can't fill both ComboBoxes at the same time? That way, you're only enumerating the data once. Otherwise, you have to enumerate the data again, either from the datasource or from the first ComboBox, to fill the second ComboBox. You could still try databinding, but it's a bit more complex than the .NET version. Try this[^] for an example in VB6.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a term or practice of running an application on a web server? I would like to run a program either console application to send commands to my ASP.net application on shared hosting. Some commands would drop tables, delete expired records, and update table data.
Should I use a web service or windows service to perform these tasks or is there another method for employing these executions? Is it possible to write something like this and have it running as a background service?
Also, I would like it to run it as a process with at any time an option to disable the process. Consider the term "web application sub-worker."
Any help or comment about this would be greatly appreciated. Thank you.
M.R.
a2leadpencil@hotmail.com
AOL: bgppa1
Yahoo: slatequarry
|
|
|
|
|
leadpencil wrote:
I would like to run a program either console application to send commands to my ASP.net application on shared hosting. Some commands would drop tables, delete expired records, and update table data.
These are things you do with SQL commands. You could do it with the SQL Query Analyzer. It would bypass your ASP.NET site completely. If you wanted to, you could create a WebService that takes commands you type in SQL and forwards them to the SQL database, but that would represent a huge security risk.
Are you talking about an AUTOMATED method of running these commands on a schedule? In that case, SQL Server has it's own scheduler service for running batch commands like this on a schedule. All it would take is putting these commands into a stored procedure, the setting up the scheduler to run it.
If you running your site on a shared host, I don't think the owner's will let you install a background process on their servers.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi everbody
iam using an application in which iam using an exe audioplayer called big hand which will play only
text messages.i have a rich text box in my form what i have to do is i have to type all the text
messages that are played by this big hand player.when ever i run this big hand player it is showing some common dialog box and asking what file should be opened.
my problem is how to capture the file name when iam opening the file and the same file name should be present when ever i save(for the first time)my text that i have typed in rich textbox in the common dialog box
and again is there any solution for keeping this exe file fixed into the file so that when ever i close the form that exe should also be closed automatically
thank you all
thank you for your reply for keeping an exe file into vb form as mdi child
thank you once again
|
|
|
|
|
I already answered this in the email you sent me.
saimram wrote:
my problem is how to capture the file name when iam opening the file and the same file name should be present when ever i save(for the first time)my text that i have typed in rich textbox in the common dialog box
You can't capture the filename from a Dialog that was opened by another application.
saimram wrote:
again is there any solution for keeping this exe file fixed into the file so that when ever i close the form that exe should also be closed automatically
You can't embbed another .EXE into your own application. You can launch it as an external application using the Process class. You can then close that process when your application closes, in your Closing event handler, by calling .CloseMainWindow on the Process object that your got when you launched the external application (BigHand player).
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey all,
i ve been trying for ages to find the code to control the pocket pc volume from vb.net but no luck...i know im supposed to use waveGetVolume and waveSetVolume however they didnt work with me or i didnt know how to use them exactly......
also, how can we set the pocket pc on vibrate from the vb.net code?
|
|
|
|
|
This question would be better handled in the Embedded/Mopbile Forum...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
The Registry key to get current user name is like below. What is the registry path to get current user login time??Any help?? Thanks~
Private Sub GetCurrentLoginName()
Dim reg As RegistryKey 'the reg key
Dim subKeyName As String 'key names
reg = Registry.Users
If Not reg Is Nothing Then 'check maybe keys does not exists
For Each subKeyName In reg.GetSubKeyNames
reg = Registry.Users.OpenSubKey(subKeyName & "\Software\Microsoft\Windows\CurrentVersion\Explorer", False) 'open the subkey
If Not reg Is Nothing Then 'check
If reg.GetValue("Logon User Name", Nothing) Is Nothing Then 'read
'no user found in this subkey
Else
loginName = "Login Name: " & CType(reg.GetValue("Logon User Name", Nothing), String)
End If
End If
Next
End If
reg.Close()
End Sub
|
|
|
|
|
Well, you have a few problems...
1) The last logon time is not stored in the registry.
2) The last logon time is not stored for local accounts, only for domain accounts and only on the domain controllers.
3) The last logon time is not replicated between domain controllers. You have to query the account information on each domain controller, then compare them to see which last logon time is the latest, then use that time as the last logon time.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Private Sub NotifyIcon1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.Click
Me.ShowInTaskbar = True
Me.WindowState = Windows.Forms.FormWindowState.Normal
Me.Show()
End Sub
Private Sub NotifyIcon1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.DoubleClick
Me.ShowInTaskbar = True
Me.WindowState = Windows.Forms.FormWindowState.Normal
Me.Show()
End Sub
I try to double click, but it doesn't show me the form i intended to show. How come the events doesn't work?
I set the visiblity of notify icon from the windows service to true, then check the "Allow interaction between desktop" in the Services (Control Panel). But the notify icon, still doesn't show the form when i click or double click...
Learning .NET
|
|
|
|
|
In my mdi-container, I have an instance of magic's docking manager.... To this instance tools are added and docked to the left...
I also have a bunch of main munus displayed on top of my MDI-container.
Now, I have tried adding a toolbar to this dockingManager instance such that the toolbar appears on top of all the other docked items on the screen.
Well, after a lot of tries I gave up and I just decided to add the toolbar with a floating state and if the users want they can dock the toolbar to the wherever they want.
Now the question is, how do I get rid of that ugly blue caption of the toolbar. Before rushing into answering, I know I can set the caption to false, but that only gets rid of the title. I want the entire caption lines gone....
Hope some one can help
Cheers!
|
|
|
|
|
The toolbar becomes a Toolwindow. You can't get rid of the top caption bar, only, as you have found out, removing the caption text. The caption bar is required to keep the functionality of moving the tool window and having a place to put the little X (Close) box.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Im designing an application where the user priviledges to each menu option are stored in a database. So on form_load I read the values from the database and appropriately set mnuItem.enabled to true or false. Currently I am using a case statement similar to:
Private Sub EnableMenus (ByVal mnuName as string, ByVal blnEnabled as boolean)
Select case mnuName
Case "mnuAction1"
me.mnuAction1.enabled = blnEnabled
Case "mnuAction2"
me.mnuAction2.enabled = blnEnabled
etc
etc
End Select
End Sub
I would like to do something like:
Private Sub EnableMenus (ByVal mnuName as string, ByVal blnEnabled as boolean)
mnuMain.MenuItems.Item(mnuName).Enabled = blnEnabled 'however Item only accepts an Integer index value
End Sub
Any thoughts?
willie@ipact.com
|
|
|
|
|
Are you just trying to enable a menu like after you click on a button, or are you trying to use it as a function to be Called by another procedure?
|
|
|
|
|
I am enabling / disabling menus on form load, and when a different user logs into the application. So, I am wanting this functionality in a callable subroutine.
I am thinking that there should be some meta data to achieve this in System.Reflection.Assembly, but I have not found it yet.
|
|
|
|
|
Are you going to use ASP for the login or are you going to generate a form that will test the condition of whether the username and password are correct?
|
|
|
|
|
Logins will be handled via a windows form.
|
|
|
|
|
OK if I understand you correctly. You would have to set up a control, maybe make it invisible, that test the preference of the user to decide whether to enable the menu or not. You can do that by making the values of the menus be conditions that must be tested before being done. I personally would use an access table with the username, password, and the conditions I wanted the user to have, as far as the menus are concerned. Then I would have a label with the username entered into it after a successful logon, and then i would have a select statement that would base the preferences, or menus, for the and I would use an if statement or case statement for testing the values of the condition to determine whether to enable the menu or not.
I hope that helps you some at least.
|
|
|
|