Answer Questions
AKW2006 getting a random number between numbers that not following each other
i want a random number out of lets say 5, 8, 15, 65 and 99 how can i do this thanks in advance Try this (uncompiled & tested code): //Create the result set int[] numbers = new int[]{5,8,15,65,99}; Random rand = new Random(); //Randomize the index int index = rand.Next(numbers.Length); //Get the random value from the result set int randomNumber = numbers[index]; So, you must first define the result set. In this case it is [5,8,15,65,99]. Then you just get the random index, and select a value from resultset with that index number. ...Show All
Expressman Problem w/ creating a Access 2003 database connection
I am working on a school project that I have to connect to an Access database and have it display the table information in a DataGridView and then based on the row selected input the first, last name in a combobox. However, when I try to do an "Add Connection" when I try changing the connection from the SQL Database to Access Database it asks me for a connection string. I have tried everything and nothing works. I have uninstalled and reinstalled Office 2003 and VB Express 2005, to no avail. I have read on this forum where others have had similar problems, but the standard answer is do it in code. I cannot do this as the instructor will not allow it. Other than using a friends PC and seeing if it works, I am stuck. I am using WinXP with Sp ...Show All
DevboyX Starting visual basic
I just got out of college and I understand visual basic, but we only used it in the .net stuff so how do I just write regular visual basic and how do I save it. say to make a macro or such can someone give me a heads up on how that works You can also check out some of the books and videos we have to jumpstart you using VB.NET (assuming that's what you want to start with). Free VB 2005 book: http://msdn.microsoft.com/vbrun/staythepath/AdditionalResources/IntroTo2005/default.aspx Starting VB videos and learning content: http://msdn.microsoft.com/vstudio/express/vb/learning/default.aspx If I didn't understand the question let me know what product / areas you're interested in learning. Best, Paul ...Show All
Thoras Sample code for VB 2005 that does not work.
I am learning VB 2005 Express Edition with a sample in the class09 that is found in the MS web page. I am trying to save new records to the customer table but the records are not saved. This is what I am doing: I run the program. I add more records. With navigator I go back and I can see the new records. I close the program. I check the in database and the new records are not there. Seems like the records are saved in the DataSet but they are not saved in the table. The sample has the following code located in the click event of the Save button in the BindingNavigator object: Private Sub bindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) If Me.Validate Then M ...Show All
droujav INSTALLING VS WEB DESIGNER
I am new to Visual Studio. I have been trying unsuccessfully to download VS Web Designer in the last few days. I have downloaded the .Net Framework 2; then VB Express and SQL 2005 Express. When the download of the Web Designer tried to install, there was an error message that a copy of the setup was already in place, or something like that. An attempt to download the Microsoft Expression Web Designer from the Start Page of Visual Studio VB Express also failed. What am I doing wrong Thanks, Weston. I tried installing again, and this time there was no problem. Can you please post your install logs so that we can better analyze the failure They are located in %temp% and a ...Show All
BS.Chen Why doesnt this work ?
Im trying to make a delay for 2 seconds... This is what im trying to do: 1. Button click 2. event happens 3. wait 2 seconds 4. event happens 5. and so on. But i cant get the timer to work. Im pasting the code part that i cant get to work. all help is greatly appreciated. Thx Imports System Imports System.Timers Public Class Form1 Public Sub timer() Dim aTimer As New System.Timers.Timer() ' Hook up the Elapsed event for the timer. AddHandler aTimer.Elapsed, AddressOf OnTimedEvent ' Set the Interval to 2 seconds (2000 milliseconds). aTimer.Interval = 2000 aTimer.Enabled = True End Sub Public Sub ...Show All
David Day Program Changes
Is there a method to program a series of changes into the project For example, I need to add a constraint to a particular column in a series of tables. I could write a TSQL command to walk the database and add the correct constraint to the column in question, problem solved. However, since there's no easy way to get those scripts back into the project (I do know about the "Import Script" option, but exporting 10-15 individual scripts and then importing those same 10-15 individual scripts seems like quite a lot of work) I was wondering if there's a way to run some sort of set of programmed changes against the project itself Thanks for the response. Sorry I'm so late getting back. Just to clar ...Show All
lushdog Is it possible to set recursion to false?
Currently when automation script is run, an item is duplicated and incremented in subsequent runs. Is it possible to set recursion to false Thanks Test consultant If you are using a webtest, then there is not a property on the test which is doing this. Is it possible that each time you run the test that some information is being captured on your server in something like a shopping cart and each time you submit another instance is created. Hi, Can you describe what the script does, and the item that is being duplicated More information will be appreciated on this. Thanks, David Gorena Elizondo [MSFT] VSTS Thanks for the repl ...Show All
Sweed Weird variable incrementing
I'm making a noughts and crosses game. I made it with two homan players to start with and it works fine. The turn is 0 then when each player takes a turn, it increases by 1 until 9 turns taken and it stops if the game hasn't already been won. When I add an AI method to it, it follows the same procedure. Two humans Player 1 goes - turn increased - checks for AI opponent - if no changes player to player 2 Player 2 goes - turn increased - changes player to player 1 etc AI opponent Player 1 goes - turn increased - checks for AI opponent - if yes goes into AI method - turn increased - awaits player 1 input and goes through it again When I use Step Into Debug, it's fine, turn increases by one each time but when I just press F5 and play, the turn ...Show All
NiklasECG2 Inet in vb.net
So what is a alternative to inet in vb.net and the .net framework, I have seen the some code for a alternative to inet, but the code looks more complicated, is there a tutorial on using a alternative to inet in vb.net. what exactly are you wanting to do inet = internet well what exactly do you want to do In order to help you, we need as much information as possible :-) are you wanting to use a WebBrowser control, so you can access the internet like in IE Are you wanting to use Sockets to do some networking Are you wanting to use Http streams to recieve data from the internet what exactly :-) Yep, Using inet with the internet! Http Streams, Srry im new ...Show All
caligula indexed types inside class
I am trying to create my own data type. Inside that class I used List<>. I have set it as private and than I have used property to access it. The problem is with accessing values inside that list. If I try to read them it is OK, but when I try to write to them I get an error: Cannot modify the return value of 'System.Collections.Generic.List<DataTest.Player>.this[int]' because it is not a variable Does anyone know how to correct this Here is an example I made: <P public struct Player { public string name; public int number; } public class Team { public Team() { players = new List < Player >(); Player p; p.name = "tom" ; p.number = ...Show All
T72 Create a User Control Part Two
Create a User Control Part One can be found here; http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1144426&SiteID=1 well copy and paste didn't work for me, but it did for Andreas Johansson I've managed to get all of the subs and functions from the form into the control with only two squiggleys one under FileInfo and one under DirectoryInfo after looking at the error corection tips I changed them to the following ; For Each objFile As IO.FileInfo In New IO.DirectoryInfo ("C:/Pics").GetFiles(Filetype) all squiggleys gone, even with Option Explicit On! see I do listen to advice. On the form I have this, Private Sub Button1_Click_1( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ...Show All
JoeBlow123 Getting a handle to an Embedded Resource File
I'm having difficulty obtaining a handle from an embedded resource file. The file is in the project name space, and I can access it using the ResourceManager. My third party .Net application wants a handle from the Kernel32.dll FindResource using: Declare Function FindResource Lib "kernel32" Alias "FindResourceA" ( ByVal hInstance As Integer , ByVal lpName As String , ByVal lpType As String ) As Integer hResInfo = FindResource(0, "MY_SKIN_FILE" , "SKIN" ) always returns 0 Any suggestions on what I'm doing wrong Thank you. I am not an API expert but it looks like 'LoadLibraryEx' API is supposed to be used ...Show All
ywchen Datawarehouse, how can I do?
Hi, I want to know how can I do a Datawarehouse, what requirements have how can I'm configurate my Team Foundation for get a good a datawarehouse Any idea, RCh, I've moved this to the Reporting forum where someone can help you. I want to initiate tu use a Cube from Team System, but I don't know if exist some requirements for initiate a cubes, which is the correct form to do it , or maybe if you have some link than can help me. Thaks, and sorry for my english! Are you interested in creating custom reports using the same cube that the Team System out-of-box reports use The Team Foundation Reporting Cube (TfsWarehouse database -> Team System cube) is create ...Show All
Leandro Rodrigues SOMEBODY SAVE ME
<WebMethod()> _ Public Function HelloWorld() As String Return "Hello World" End Function .this web service will return the word hello world .now what i wanna do is to return information from my database .how to i go about it cos i donnoe what i should declare my database by...should it be string , int or whatever it is i tried everythinh and there always an error .btw my database is named as PanHotel.mdf its not particularly helpful..im still clueless Hi wiscon, i suggest you read this book: " Introducing Microsoft Visual Basic 2005 for Developers " ref: http://msdn.microsoft.com/vba ...Show All
