Using For Next Statement To Generate Dirs?
Aug 24, 2011
I want to use this code to generate 10 folders
Sub CD()
My.Computer.FileSystem.CreateDirectory("c:Dir")
End Sub
Dim i As Integer
For i = 1 To 10
CD()
Next i
But it doesn't work.
View 9 Replies
ADVERTISEMENT
Mar 23, 2010
I didn't see a question on this subject in the archives, so here goes: For those of you experienced Mercurial users, is this a correct .hgignore file to tell VB.Net Express to ignore files/sub-dirs when adding items in a new repository?
[Code]...
View 1 Replies
Jun 25, 2011
Here Is my code
Public Sub MoveAllFolders(ByVal fromPathInfo As DirectoryInfo, ByVal toPath As String)
Dim toPathInfo = New DirectoryInfo(toPath)
If (Not toPathInfo.Exists) Then
toPathInfo.Create()
[code]....
My goal is to move all folder inside a folder into a folder named Folders.so If I do it on desktop all the folders in desktop will go to "Folders"but I get an error "The process cannot access the file because it is being used by another process."
View 1 Replies
Oct 14, 2009
See
Public Class Form1
Dim sql As String
Dim conn As New OleDb.OleDbConnection
Dim da As New OleDb.OleDbDataAdapter
[CODE]...
The problem, The INSERT statement works fine in the form load but not in the button click event?
View 29 Replies
Jan 1, 2010
I was convinced that If <expression> Then <statement [:statement]> Else [statements] in concrete form of If a = b Then SayHello() Else SayBye() End has sense. I read article on msdn on If-then-else, but I forgot why I was reading, so I concluded, that snippet above means this
If a = b Then HelloIsSaid : IsNotEnded Else ByeIsSaid : IsEnded But I have tested it now, and I see, that Else without statement is nothing more than decoration. It would be pretty good if it had function I described. Do you think its good request? Or do you know any circumstance where this Else has some function?
View 13 Replies
Jun 8, 2009
y friend and I are re-learning Visual Basic, and we are stumped on this bit of code.
For intAsterisks As Integer = 0 To intLine - 1
lblAsterisks.Text = lblAsterisks.Text + "*"
Next
View 6 Replies
Jun 24, 2011
I have the following SQL:
[Code]...
I want to put it (the select count statement) in this LINQ statement so I can get the sales count in my linq statement: Dim TheLeads = (From L In DB.Leads Where L.IsDeleted = False Select L).ToList() Is this possible to do in LINQ?
View 1 Replies
Feb 23, 2009
add an if statement and an exit statement to my do loop that exits when my future value (FV) is greater than 1000, then to change the exit statement to a continue statement so my loop will continue even though my fv is greater then 1000, point is to get this to run even though my if statement doesnt do anything. problem something wrong in my code and an exception error (xception of type 'System.OverflowException' occurred in mscorlib.dll)
so can someone show me where or why I have an error is, what am I overthinking now! I could use a hint, OMG i could use a tutor for that matter
[Code]...
View 3 Replies
Jun 23, 2010
A co-worker wants to convert the following IfThenElseIf statement into a Select Case statement.
Explain why this is not possible.
If temperature = 100 Then
X = 0
ElseIf population > 1000 Then
X = 1
ElseIf rate < .1 Then
X = -1
End If
View 7 Replies
Aug 4, 2010
I cant get this SQL statement to insert any of the values in the form to add to the database
sql
sql = "INSERT INTO prevresults (ExamDate, ExamTime, CorrectAnswers, PassPercentage) VALUES (date.now, time.now, rightanswers, percentage.text)"
[code]....
View 4 Replies
May 24, 2012
Return statement which is true in an if statement
View 3 Replies
Apr 22, 2011
I'm writing something that will examine a function and rewrite that function in another language so basically if inside my function F1, i have this line of code var x=a.b(1) how do i break up the function body into symbols or "tokens"?I've searched around and thought that stuff in System.Reflection.MethodInfo.GetMethodBody would do the trick however that class doesn't seem to be able to have the capabilities to do what i want..dit 2:basically what I'm trying to do is to write a program in c#/vb and when i hit F5 a serializer function will (use reflection and) take the entire program (all the classes in that program) and serialize it into a single javascript file. of course javascript doesn't have the .net library so basically the C#/VB program will limit its use of classes to the .js library (which is a library written in c#/vb emulating the framework of javascript objects)
View 4 Replies
Oct 5, 2009
how to use them then before, but am still a little confused with a few aspects. Here goes:
1.) Lets say you have a method that checks for a certain condition(s) and if it fails Throws an exception. Does it have to be in a try/catch block? Meaning can the "Throw" statement exist in a block with no try/catch statement?
2.) Now lets say we have a method that has a try catch block and in it there is a throw statement. When the throw statement is executed does it first try to find an appropriate catch block in the same method or does it immediately go back to the calling method without looking at the catch statements in the current method where the exception was thrown?
3.) I created a custom exception class that inherits from ApplicationException. Next I created a method which has a catch block that catches this type of exception and does some action. Is the System(i.e CLR) smart enough to throw an exception of this type, or does it only throw exceptions from SystemException?
4.) I know that some people are more liberal in their use of exceptions and others use it more sparingly when truly strange stuff happen like the DB going down. I am writing code where I am getting some info back from the database, converting it and then storing it. Sometimes there might be data that comes back from the database and other times the field is empty and the Null value comes back. Therefore in the instances where Null comes back from the database I should not convert the value to anything, since I will get an error. What should I do in this situation? Should I let the CLR throw the exception when it goes to convert the Null value or should I check for the Null value and if it exists not convert?
5.) In general when I throw exceptions, is it sensible to only throw exceptions of the type Application Exception or are there instances where the programmer throws exceptions of the type SystemException?
View 2 Replies
Jul 11, 2010
I'm building a listview search feature in my app. (See the code below). It works really well, except if you search "T" then the code removes all items, if you search "t" then it removes every item except for those starting with "t". Is there any way to make a 'like' statement, or use some kind of wildcard to make the statement not case sensitive?
For Each itm As ListViewItem In ListView2.Items
If itm.Text Like TextBox1.Text & "*" Or itm.SubItems.Item(1).Text Like TextBox1.Text & "*" Then
Else
[code].....
View 2 Replies
May 2, 2012
I have a line of code that is working in one statement but not the second statement. I'm not sure what I'm doing wrong, I am learning slowly but surely, and it is by no small margin because of the ave found here =) The error is occuring in the intResult = intSelection x intCount line of the SECOND Do While Loop.
The blue squiggle line is under "intCount" just FYI
Dim intSelection As Integer
Dim intCount As Integer = 0
[code]....
View 1 Replies
Jan 29, 2009
I have the following vb code which works as expected when it's in a code-behind page. I tried to move it to a shared or component page since I will need to use it in multiple pages:
Imports Microsoft.VisualBasic
Public
Class DetTime
'Determine eastern time
[CODE]...
However the "if" statement shows an error " statement cannot appear outside of a method body" and the Microsoft solution is to "move statement into a procedure or subroutine"
View 1 Replies
Oct 31, 2011
I have coded a case statement that changes the background colour of a panel. [code]When the code is run, it works for the case of colour1 that is NOT 1 or 2. However, when the colour1 is 1 or 2, it is supposed to pick a number from set array and run another case statement. Instead, it only picks the last value (for 1, this is 5, and for 2, this is 7).
View 3 Replies
Apr 15, 2011
How to generate the API of my Site ... www.volvobusesindia.com so that i can provide my site API to agents so that cthey can vbook tickets using our API ?
i want the bus booking search box appear in the site will be displayed in others website ?
View 2 Replies
Feb 1, 2012
I am writing an encryption application that requires a 64 bit key. I am currently using the following code to automatically generate a key.
Function GenerateKey() As String
' Create an instance of a symmetric algorithm. The key and the IV are generated automatically.
Dim desCrypto As DESCryptoServiceProvider = DESCryptoServiceProvider.Create()
[code]....
I am wanting the user to create their own key. Can I convert a user defined password (a string) into a 64 bit key that can be used?
View 1 Replies
Nov 20, 2009
I want to build a kind of a tone generator to tune my Ukulele (NERD allert, sorry for that).I know there are enough tone generators available but since a Ukulele has only 4 strings and not in the same order and tone as a regular guitar, they won't help me. My objective; to build a small VB.NET form with four buttons and every button will generate a specific tone.I've already tried Console.Beep etc [URL] but all I hear; no beep.As seen on the page at this link: QuoteThe Beep method is not supported on the 64-bit editions of Windows Vista and Windows XP.As far as I know, I'm not running a 64-bit Windows Vista, however, I'm running on a 64-bit processor.
I've tried Google (one of my best friends, but we seem te be in a separation?) but all I can find are examples in C# (since it is about music, C# is a regular tone, however I don't know anything about C# as a programmers language...) and the examples there are in VB.NET are about extreme big applications like digital piano's etc.
View 14 Replies
May 12, 2006
I want to generate a unique ID in VB.NET that starts with ASXXXXX where XXXX represents a number. The number has to start in an orderly fashion. This ID will then be stored in a SQL Server express table.
View 8 Replies
Apr 8, 2009
how can generate (and display) images on the fly for simple charting, resizing etc?
View 3 Replies
May 26, 2011
I'm using the below function to generate an MD5SH1 hash for SQL backup files.This works well, has progress report etc but is slow if using large files.
Could I generate the MD5 at the same time as SH1 rather than having to process the file twice, doubling the time taken? What about converting an MD5 result to SHA1?
Imports System
Imports System.IO
Imports System.Security.Cryptography
Imports System.Text
[Code]...
View 1 Replies
Sep 20, 2010
I am a beginner in VB.NET. I have made a small project and now i would like to make some reports to complete the project.
how i can work with reports in VB.NET. I want to retrieve data from SQL Server 2000 using Stored Procedures and generate a report in VB.NET.
View 1 Replies
Jun 3, 2009
Is it possible to generate the sample xml(Used as Request xml for web service)from the xsd using vbscript code?
View 4 Replies
Aug 24, 2009
i would like to generate a very simple report with some images and text and i am wondering if there is a way to generate a pdf file with vb.net?
View 4 Replies
Jan 25, 2010
I'm very dumb in vb.net or any .net languages. Actually while I was creating a package using SQL Server Integration Services, I had a problem. This problem can be solved using VB.net script.
Here is my scenario
I've a database table like this
ColA ColB ColC
[code].....
View 3 Replies
Oct 23, 2009
I want to generate a matrix (7,4) with this output: (7lines and 4 columns) that has this structure(with this values)Column A1 and row B1 has 2 values (1 8 ), column A2 has 2 values (2 7 value in column A2) , column A3 has 3 6 value column A4 and row B1 has 4 5 value. And so on.How I can generate this matrix: [code] So my question is which condition to put to generate this matrix of this form.A cell A1,B1 contains two values (1 and 8 for example in cell B1).
View 1 Replies
Apr 1, 2009
how to generate the formula. want to use arraylist to store and for loops to loop the formula til the system can detect which staff it should giv the ticket to..below is the scenario:this is a helpdesk system..so each ticket they submit muz be auto assigned to a staff to attend their ticket..each staff has a different quota..so i came out wid this algorithm on hw to determine who the ticket shld go to..
for ex: i set one ticket's quota is 7%
staff A's quota - 47% staff B's quota - 35% staff C's quota - 18% so to knw how many tickets A get den B getx 1 ticket and how many tickets B get den C gets 1i came out wid a calculation like this -
Staff A - 47% / 7% = 6.7(max no.of tickets he can receive foe a period of time)
Staff B - 35% / 7% = 5
Staff C - 18% / 7% = 2.5
so first i compare A&B whr i took 6.7/5 = 1.3 -> so every 1.3 ticket A gets,B gets 1 ticket den i compare B&C whr i took 5/2.5 = 2 -> so every 2 ticket B gets,C gets 1 ticket i wanna implement this concept in my code..but i dunno how to come up wid this formula..
View 14 Replies
Sep 8, 2011
All I want is to generate an ID to my listview per row it is possible? For example I have 10 records in listview and I want to add an ID per row in randomly... Here's my sample picture... but it's wrong...coz' at the column 3 it's a repeating ID...
View 1 Replies