|
i have been messing with vb for about 3 months now and i am trying to find the code to where you can click browse and you can search you pc for the file you want then it loads the file to a datagrid, i have tried my own code and alot of others form the net but all give build errors and i cant seen to fix them.
can someone please link me to or tell me the cod that allows you to search for certain files and load them to a data grid.
-Chris
|
|
|
|
|
FreakNikon wrote: have been messing with vb for about 3 months now and i am trying to find the code to where you can click browse and you can search you pc for the file you want then it loads the file to a datagrid
What kind of file you are trying to display in the Datagrid? Datagrid is for displaying the records from a database. You can use Dataset for this purpose. Or you can also display a CSV file in the datagrid.
AliAmjad(MCP)
|
|
|
|
|
well lets say im trying to load a text fie into a datagrid. what would i put to load the file into the datagrid
|
|
|
|
|
I was wondering if this was possible....i know i can use a VB Variable in javascript using <%= strRandom %>. But it doesn't seem as easy to pass a javascript variable to a VB variable.
|
|
|
|
|
You can't. They are two entirely different runtimes that don't know anything about each other and provide no methods for communication between them. What you're doing in your code example is actually replacing the <%...%> tag with the value of the variable in the HTML. The Java code doesn't even know VBScript exists.
|
|
|
|
|
Yeah, I just used a hidden object to store the value and take it from that.
But thanks for the reply
|
|
|
|
|
I have a question... I have a datagrid populated with a large list of information. I have a text box above the datagrid and i want it to be possible for the user to click inside the textbox and type a letter and the list jumps to the row on the datagrid beginning with that letter. As the user continues typing in letters it brings matches up to the item on the list that most closly matches what is being typed.
The way I have it now is that the user can type in a word and it finds that row in the datagrid. I want it to match up to the letter. any clues?
This code is what i have now...it finds the item by number or acronym typed in the text box but you have to type in the whole number or acronym...not just one letter.
Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged<br />
Dim intItemFound As Integer<br />
This will search the programlist for whatever the user is inputting in the textbox<br />
If Me.rbAcronym.Checked = True Then<br />
intItemFound = Me.m_bndProgramList.Find("REVISION_ACRONYM", txtSearch.Text)<br />
Me.m_bndProgramList.Position = intItemFound<br />
ElseIf Me.rbNumber.Checked = True Then<br />
intItemFound = Me.m_bndProgramList.Find("BASE_PROGRAM_NUMBER", txtSearch.Text)<br />
Me.m_bndProgramList.Position = intItemFound<br />
End If
Erica
|
|
|
|
|
The Find method doesn't support wildcards and will match onlt the entire search string, case-insensitive.
If you want to narrow down what the user sees, then you can use the Filter property of the BindingSource and use something like:
Me.m_bndProgramList.Filter = String.Format("REVISION_ACRONYM LIKE '{0}%'", txtSearch.Text)
This will return all of the records that have a value in the REVISION... column that starts with the text entered in the TextBox.
|
|
|
|
|
thank you soooooo much. Now it does exactly what I want...YAY
Erica
|
|
|
|
|
I have a series of windows that have windows inside and I wish to lock them together so if the outer window is expanded the inner window will follow.
|
|
|
|
|
Handle the Resize event of the outer window. In there, calculate the new size of the child windows appropriately for your situation and set the Size property of the child windows.
|
|
|
|
|
Do you have an example of this.....
|
|
|
|
|
Dude, seriously?
Look, I remember being a beginner too but when someone tells you what to do you really need to have the where with all to go figure it out form there.
If we do it for you then you will not learn anything.
|
|
|
|
|
Hi,
how can i generate a gant-chart in microsfot visio 2007?
i will import data from a ms sql server and generate a gant-chart in visio.
thx 4 help
Robert
thx Robert
|
|
|
|
|
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
|
|
|
|