|
hi i have a textbox and a datagrid .i want to show records in datagrid when i enter first letter and then second letter of the text and automatically go on it(without press a key)
please help me immediately!!!!!!
|
|
|
|
|
Capture the OnKeyPress event of your textbox and get the current text from your textbox to update your datagrid.
|
|
|
|
|
Hi All,
I have the following code to create an array list
[code]
objConn.Open()
Dim Scores as ArrayList
Dim s as Integer
s=0
Scores=New ArrayList
Dim strSQL4 as String = "SELECT CriteriaID, Score, ScenarioID, UserID As SumScore FROM tblMatrix"
Dim objCmd4 as New OleDbCommand(strSQL4, objConn)
Dim objDR4 as OleDbDataReader
objDR4 = objCmd4.ExecuteReader()
While objDR4.Read()
Scores.add(objDR4("Score"))
s=s+1
End While
'Write Out Contents of Array (Sum of Scores)
For s = 0 To Scores.Count - 1
Response.Write(Scores.Item(s) & " ")
Next
DataBind()
objDR4.Close()
objConn.Close()
[/code]
And a similar one to set up an ArrayList called Conf.
I then have the following code to multiply the values in the arraylists together:
[code]
Dim x as Integer
For s=0 to Scores.Count - 1
x = (Scores.Item(s)) * (Conf.Item(c))
Next
[/code]
But I recieve the following error:
[code]
Index was out of range.
Line: (Conf.Items(c))
[/code]
What is wrong with the code and how do I fix this?
Thanks
DJ
|
|
|
|
|
You have not reinitialized the variable c in the multiplication loop. Only variable s is initialized but you are using two arrays with two different array index variables. Assuming that both arrays are exactly the same size, perhaps you meant to use:
Dim x as Integer
For s=0 to Scores.Count - 1
x = (Scores.Item(s)) * (Conf.Item(<big>s</big>))
Next
...Steve
|
|
|
|
|
Thanks Steve,
That seems to have worked. I am new to this and thought you had to use the same variables as the previous declared arrays.
Thanks again.
DJ
|
|
|
|
|
Anytime DJ. If the arrays are not the same size (or not 1-for-1 correspondence between the members) you'll need to use as many loop variables as required but in this simple case you only need the one loop variable to control access to both arrays. In fact provided the arrays are the same dimension etc... you can control 'n' arrays with only one loop variable.
...Steve
|
|
|
|
|
There is a VC++ dll, which has input parameter like this:
int Func(char * inputpara)
{
...
}
How to pass the parameter to it in VB.net?
The string seems has problem.
Thanks!
|
|
|
|
|
Hi
First when creating your dll, try using the "Create a dll that exports some items" template.
Then you see the sample exported function is declared as:
<br />
int WIN_API Func (...) <br />
{<br />
...<br />
}<br />
WIN_API (the name also contains your project name) is #defined in .h file.
It must be present so that the dll knows what functions to export.
also try adding the __stdcal to the function definition after WIN_API .
Then the functions are accessible from outside the dll.
Also should declare the functions in the .h file.
Then add a .def file that has the exported functions names.
Ask me to describe more if you had problems doing so.
|
|
|
|
|
I am not sure this may help but maybe you need to marshall your data before calling the API. So instead of passing a string, declare your variable as follows:
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=128)> Private inputpara() As Char
|
|
|
|
|
hi i need to save the file name with current system month and year... i also need to give the phy_path to store the file... when i try to run the applcation i get different file name for ex: if i given filename as "checkurl" and run it is saving as "c2eckurl" i dont wht wrong with it here is my code snippet
Dim str As String = "checkurl_"
Dim strfile As DateTime = DateTime.Now
strfilename = strfile.ToString(str + "MMM, yy")
can any body explain me.
regards
cyus
|
|
|
|
|
This is happening due to str + "MMM, yy" (i.e. "checkurl_MMM, yy") being used as a format string to the strfile.ToString() method. The "h" in "ch eckurl_" is being treated as a time formatting character.
Maybe your last line should read:
strfilename = str & strfile.ToString("MMM, yy")
Lookup the help on the DateTime.ToString() method for more details.
...Steve
|
|
|
|
|
thanx for the tip i want to display only month can u guide me
strMonth = strfile.ToString("m")
the above code snippet display month and date i need only month
regards
ybasha
|
|
|
|
|
Hello...
strMonth = strfile.ToString("MMM")
This will return the month in text form to the string strMonth
Tell me if you have any problem
_mubashir
|
|
|
|
|
i already got that thanx for the info....
Regard
ybasha
|
|
|
|
|
hi i need to save the file name with current system month and year... i also need to give the phy_path to store the file... when i try to run the applcation i get different file name for ex: if i given filename as "check" and run it is saving as "c2eck" i dont wht wrong with it here is my code snippet
Dim str As String = "checkurl_"
Dim strfile As DateTime = DateTime.Now
strfilename = strfile.ToString(str + "MMM, yy")
can any body explain me.
regards
cyus
|
|
|
|
|
Dim str as String
dim strfilename as string
str="checkurl_"
strfilename=str & format(now,"MM-YY")
Jojomonok
|
|
|
|
|
Hi,
Does anyone have a sample code or have an idea about how to Export a treeview control to Excel?
Thankyou. all help is appreciated.
Aartee.
...HE is watching Us All!
|
|
|
|
|
Hi all, I have a few COM DLLs in a project which have had MS Office UserForms imported into them. These are causing some problems and I have been advised to convert them all to native VB Forms instead. Only problem is this seems to be a 'search and destroy' exercise since you cannot copy and paste between an imported UserForm and a native VB Form - you need to rebuild them from scratch.
If I had only a couple of forms this would be easy, but since there are 27 and many of them are quite complex I am searching for a method to convert them insitu if possible or via a utility outside of the VB IDE (this is VB 6.0 not .NET (yet)).
Does anyone know of a method by which this can be achieved?
...Steve
|
|
|
|
|
I don't believe that's possible. I've never even heard of a tool to do it. I would also tend to believe that one doesn't exist since I believe this would be a rare case and never should get past the design stage of a project.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave, I totally agree. This system 'evolved' but without the 'natural selection' part Can't blame any of the developers since they have done an otherwise outstanding job - just a circumstance of the real corporate world in which I live.
The problem is that I can't build the COM DLLs with binary compatibility when they have UserForms as this always breaks them.
Just wanted to save myself a day or so reconstructing these forms.
Worth a shot anyway. Thanks for your post.
...Steve
|
|
|
|
|
Hi everyone,
Might be a silly question:
1) Does anyone know if I can use a SQL Server 2000 database instead of SQL Server 2000 CE database in a Windows CE application?
2) Any recommendation of books or website links that I can use to get an initial idea about the database programming of smart devices with VB.NET? I am really a new bird in this area.
Thanks a lot.
Frank
|
|
|
|
|
Hi, I'm trying to write a fairly program, but it requires me to take individual characters from a string. For example, say the string is
"I'm confused" the program needs to take say the fifth character "c" from "I'm confused". I haven't done much programming and what I did do was several years ago, so I don't remember or know how to accomplish this in basic... So, any help would appreciated.
you can email me at csel.poiuy@gmail.com
|
|
|
|
|
nm i figured out how... sorry to bother you guys lol
|
|
|
|
|
I'm looking for convertion source code (etc. word , powerpoint , pdf) to html by vb.net or asp.net
It's important! help me please
Thanks.
|
|
|
|
|
Pookky wrote:
by vb.net or asp.net
I'll also mention that ASP.NET is not a language, it's a platform.
Christian Graus - Microsoft MVP - C++
|
|
|
|