|
Not sure how, but if you find a way, share it with everyone
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
HI all,
I want to declare dyanaic arrays.How can I. I am trying like this but it is giving error ?
Dim Names() As String
Sub New(ByVal st As List(Of String))
st.CopyTo(Names) <-- value cannot be null error
End Sub
How to solve this
Thanks in Advance
Dana
|
|
|
|
|
I believe your problem is you haven't created your Names array yet.
So I think your code should be something like:
Dim Names() As String
Sub New(ByVal st As List(Of String))
if Names is nothing then
Names = new String(st.Length)
end if
st.CopyTo(Names) <-- value cannot be null error
End Sub
Anyway, hopefully you get the idea.
Ben
|
|
|
|
|
Thanks Ben,
But it is giving RunTime Error.Becuse these method (Names = new String(st.Length)) is not supported in Vb.net
Dana
|
|
|
|
|
Ok try this:
private Names As String()
Sub New(ByVal st As List(Of String))
st.CopyTo(Names) <-- value cannot be null error
End Sub
Ben
|
|
|
|
|
It doesn't work because the Names array doesn't have any elements in it. If you delcared the array as:
Dim Names(10) As String
it would contain 11 elements of type String, all with the value of String.Empty.
The way you've done it, there are no elements in the array. You'd have to ReDim the array to the proper size, then call CopyTo
Sub New(ByVal st As List(Of String))
ReDim Names(st.Count - 1)
st.CopyTo(Names)
End Sub
But, I highly recommend changing the array to a List.
Private _names As List(Of String)
Public Sub New(ByVal st As List(Of String))
_names.AddRange(st)
End Sub
|
|
|
|
|
Thanks Dave.....
It worked well
Dana
|
|
|
|
|
I'v created a report in visual studio using crystal reports.
And everything works fine as long as I test it on a machine wich visual studio installed.
Otherwise I get a error and the prog closes.
Ok so I went and googled this problem and found out that I need to install 'crystal reports for .net' onto the test machine.
The problem I have now is I can't find a download for this.
On the site of business objects I'v found information about this but it doesn't tell me wether or not I need to buy something or if it's a free download, or were I can download it.
http://www.businessobjects.com/products/reporting/crystalreports/net/vsnet.asp[^]
does anyone know if I need to buy one of there products and so wich one. The embedded crystal reports in visual studio is suficiant for me so all I need now is to be able to deploy it to another machine.
thanks in advance
-- modified at 9:00 Friday 26th October, 2007
[SOLUTION]
after a long search I'v found a possible solution
adding a merge module to my setup project appears to have solved the problem
since I had to search a very long time to find it here is a link in case anyone has the same problem:
http://support.businessobjects.com/downloads/merge_modules.asp[^]
the downside to this solution is that every time you install the programme this module is installed aswel (wich takes a bit longer) also the programmes size increases alot and the build time voor the setup project is alot longer.
But it works
-- modified at 9:03 Friday 26th October, 2007
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Actually i have placed some images in a single webpage with visible="false" and i need to check it with date and month, if both matches then one image has to be visible and next time when date and month matches it has to show some other image and hide the previous image. working on asp.net 2003 with vb.net
pls do this needful.
|
|
|
|
|
You should be asking this in the ASP.NET forum.
|
|
|
|
|
I am developing a web application in that I need to record audio, for that I am importing "winmm.dll" and
using mciExecute function.(the following code is in vb.net). If I have posted in irrelavent forum please let me
know where should I post questions related to audio and video (for web development).
<code>
Imports System.Runtime.InteropServices
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.Devices
Partial Class audioRec
Inherits System.Web.UI.Page
<DllImport("winmm.dll", EntryPoint:="mciExecute", CharSet:=CharSet.Ansi, SetLastError:=True,
ExactSpelling:=True)> Private Shared Function mciExecute(ByVal lpstrCommand As String) As Boolean
End Function
Protected Sub BtnStart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnStart.Click
mciExecute("open new Type waveaudio Alias recsound1")
mciExecute("set recsound1 time format ms bitspersample 16 channels 1 samplespersec 8000")
mciExecute("record recsound1")
End Sub
Protected Sub BtnStop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnStop.Click
mciExecute("save recsound1 c:\\record.wav")
mciExecute("close recsound1 ")
Dim c As New Computer
c.Audio.Stop()
End Sub
Protected Sub BTNplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNplay.Click
Dim computer As New Computer
computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background)
End Sub
End Class
</code>
but when I am clicking the start button, A msgBox with "the parameter is out of range " msg is getting displayed. I need to to record an audio file in "8khz, 16 bit, mono" format. If I change the value of samplespersec to 11025 or greater frequency it works. But I am not able to save my audio file in 8kHz format.
How can I meet this requirement.
i will be thankful for ur suggestions..
with regards,
kiran
|
|
|
|
|
The code you've come up with is never going to work. Any ASP.NET code you write in VB.NET or C# or whatever only executes on the server-side.
You need an ActiveX control installed on the client-side and usable in your HTML page that your ASP.NET code generates in order to get at the hardware on the client. Your VB.NET code will have nothing to do with this.
This is a question best asked in the ASP.NET forum.
|
|
|
|
|
help I need to map from the server to the local host.
I am having problems with my web application, i am unable to make the application read on the hard drive of the client (local) machine, i need to be able to map the path such that this application is able to upload files from the client's C:\ drive.
Any ideas....it's a VB.net application running on a web server.
thanks,
|
|
|
|
|
An ASP.NET website cannot access resources on the client machines that are accessing it, nor should it for security reasons. It simply provides a means for producing MIME-encoded data streams that can be handled by a web browser.
If you need to provide the facility for the user to upload a file from their local machine, create a page with a FileUpload control on it. The user will need to pick the file to upload of course.
Paul Marfleet
|
|
|
|
|
Hi All,
I have a two dimensional array of string carrying Name, Date & Amount of customers. The Names in the array are repeating; now want to collect all the distinct Names in the array and store it in another array (obviously one dimensional). I am using VB6. It may look like a stupid question, but I have tried everything I could have and got no results. It is very urgent.
Can any one please help me?
Thanks in advance.
Regards,
Paramhans Dubey.
|
|
|
|
|
Does VB6 offer a set class, or a dictionary/hashtable ? If not, then is there a method you could use to search the array for each string before you add it, to make sure it's not there ?
VB6 sucks BTW, I'd recommend moving to VB.NET as soon as you get the chance
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
For each item you are about to put into the "distinct" array, you have to search the array to see if it's already in there. If it's NOT in there, add it. If it is, move on to the next item in your srouce array.
|
|
|
|
|
Hi I have a login page...,
After enter that username,pwd it will go to default.aspx page...,
In that default.aspx page i have displayed some usercontrols and one iframe tag...,
In that iframe i have displayed other aspx page...,
In that aspx page i have said when the session(userid)=0 go to login.aspx page like...,
Code:
If Val(Session("userid")) = 0 Then
Response.Write("Your Session Expired.....")
Server.Transfer("login.aspx")
End If
so when the session expires it showing the login.aspx page in inside the default.aspx page iframe control...,
But it have to show when the session is expires login.aspx page on whole page...,
It mean it have to come outside of the default.aspx page also...,
So i have used javascript & modified code as...,
Code:
If Val(Session("userid")) = 0 Then
Response.Write("")
Response.Write("window.open('login.aspx','_top')")
Response.Write("")
End If
But in this i am getting error inside the iframe tag...,
I hope u peoples understand my probs,
Plz help me to solve this...,
Advance thanks,
Regards,
Magi
|
|
|
|
|
Dont cross post, you already have this same query in the ASP.net forum (which is the better forum for issues like this) with someone there trying to help you.
|
|
|
|
|
hi all
i m trying to zoom a tab control with all sub controls on it like textbox, another tab control, label, group boxes.
i already have tried the for each loop as told by dave in my early post.
can some one tell me another way to do the job, i am thinking about to increase the pixel size of the control or some thing like that.
thanks in advance
help everyone
|
|
|
|
|
I really can't add anything to what Dave Traistor already said. I really don't have a good idea of exactly what you're trying to do either. What do you mean by "zoom"?? Maybe if you draw out what it's supposed to look like before and after the zoom??
|
|
|
|
|
Hi,,,,
I am using VB6, could any one help me how to enter unicode strings(chainese language)to the string table of a VB application? And how to dispplay them on a command button?
thanx in advance!
birajendu
CyberG India
Delhi
India
|
|
|
|
|
|
Hi i am using Vb 2005 and using some other command line based applications to take some “file backups”.
I am able to execute the command by using the shell function.
My issue is that i want to know what is the status returned back. One way is to redirect the output of the commands to a file and read....
Is there any other way ???
Regards
Nishkarsh
|
|
|
|
|
If you're using the Process class to launch this, there's a WaitForExit method you can call that will block your code until the process you launched exists. When that call returns, then you can look in the ExitCode property of the Process object you created.
You can also redirect the output of the console app to your application and read it like you would a Text file. Check out the StandardOutput property of the Process class and the RedirectStandardOutput property of the ProcessStartInfo class.
|
|
|
|