Testing For Presence Of Table Row?

Nov 20, 2011

I am currently using the following code to check for the presence of an entry in a table. I choose this code because I thought it was a good idea to use a public function to reduce the amount of code required. It works fine until the field I am checking for contains a' character.I realise I need to use a parameter like @name but cannot work out how to pass the correct information to the public function.how to amend my existing code so I can use @staffNo.

Imports System.Data.SqlClient
Dim PaddedStaffNo As String
PaddedStaffNo = (TextBox2.Text.PadLeft(4, "0"c))[code].......

View 1 Replies


ADVERTISEMENT

VS 2010 : Testing For Presence Of Table Row?

May 5, 2011

I am currently using the following code to check for the presence of an entry in a table. I choose this code because I thought it was a good idea to use a public function to reduce the amount of code required. It works fine until the field I am checking for contains a ' character. I realise I need to use a parameter like @name but cannot work out how to pass the correct information to the public function. Can someone show me how to amend my existing code so I can use @staffNo.

Imports System.Data.SqlClient
Dim PaddedStaffNo As String
PaddedStaffNo = (TextBox2.Text.PadLeft(4, "0"c))

[code]....

View 12 Replies

Homework - Testing A Trace Table?

Dec 29, 2011

Working through trace tables and wanted to check to see if my results where correct, I have designed the following code to check each stage of the loop, but the code keeps throwing up an error about casting when i try to run it. I can see when the error comes back that the writeline is holding info but what have i done wrong.

Module Module1
Sub Main()
Dim aWord As String

[Code]....

View 1 Replies

Sql - Unit Testing The Data Access Layer - Testing Update Methods?

May 15, 2009

I'm looking into adding some unit tests for some classes in my data access layer and I'm looking at an update routine that has no return value.It simply updates a row based on the id you provide at whichever column name you provide.Inside of this method, we collect the parameters and pass them to a helper routine which calls the stored procedure to update the table.Is there a recommended approach for how to do unit testing in such a scenario?

View 4 Replies

Difference Between NUnit Testing And Unit Testing In VSTS?

Aug 25, 2009

I use VS team system 2008. At the moment i need to test some business classes, i have found two kinds testing NUnit and the unit testing provided by the VS team system. what are there differences?

View 1 Replies

.net - Unit Testing C# InternalsVisibleTo() Attribute For NET 2.0 While Testing?

May 13, 2010

I'm building an Active Directory wrapper in VBNET 2.0 (can't use later .NET) in which I have the following:

IUtilisateur
IGroupe
IUniteOrganisation

These interfaces are implemented in internal classes (Friend in VBNET), so that I want to implement a façade in order to instiate each of the interfaces with their internal classes. This will allow the architecture a better flexibility, etc.Now, I want to test these classes (Utilisateur, Groupe, UniteOrganisation) in a different project within the same solution. However, these classes are internal. I would like to be able to instantiate them without going through my façade, but only for these tests, nothing more.

[Code]...

View 1 Replies

Return Lync Presence With Program?

Dec 8, 2011

I am working on a solution to a problem at work where we can't tell if someone is on the phone or just sitting there. We use Microsoft Lync to place our calls and I was hoping to be able to add a bit of code to an existing .net application to show the presence of the person logged into the machine. That info will send that out via USB to an indicator light I previously built.

So basically I am trying to create a .net version of those 'ON AIR' lights you see at radio stations.

I have been searching for the last few days and haven't found a solution. I also downloaded the Microsoft Lync Controls SDK, but no luck with that either.

View 2 Replies

Check A String For Presence Of Any Character From A Specified List?

Feb 10, 2012

How would I check a given string for the presence of any match with a character listed in another string. I'm just looking for a binary result.

In other words, how would I write the VB.NET function called IsPresent in the following code snippet?

Result = IsPresent(AnyString, MyTestString)

For example, if MyTestString = "XYZ" then I want the following results for the given AnyString values:

MUTTON, Result = No
BUZZ, Result = Yes
HAPPY, Result = Yes
FISH, Result = No

View 2 Replies

Filter A ListBox Based On The Presence Of A String?

Jul 22, 2009

I am trying to filter a ListBox based on the presence of a string. Basically, if there is a ListItem that doesn't contain the string then I want to remove all ListItems that do contain the string. Here is what I have tried:

Dim Item As ListItem
For Each Item In CtheList.Items
If Item.Text.IndexOf("W:") = -1 Then

[Code].....

View 4 Replies

Verify Presence Of .net Framework And If Not Present How To Install It On User Machine

May 2, 2011

net application. .exe generated is sufficient to use software. since I have 700 MB (~8k media files) data to include as part of installation I do not want to use visual studio deployment wizard.

[Code]....

View 2 Replies

VS 2010 Can't Seem To Get The Checkbox Checked According To Presence Of A Particular String In A Text File

May 21, 2012

Everything is written in codes:

vb
'CHECK IF "sIntroSequence" IS AVAILABLE IN TEXT FILE. Dim checkthevalue As String = My.Computer.FileSystem.ReadAllText("c: est.txt") If checkthevalue.Contains("sIntroSequence") Then '"INTRO SEQUENCE" STRING IS AVAILABLE. 'CHECK

[code]....

I can't seem to get the checkbox checked according to presence of a particular string in a text file. It looks like it should work but it doesn't.

View 16 Replies

Using VB To Test For Presence Of "Save As PDF Add-in"?

Dec 10, 2009

I'm working in an environment (XP SP3, Office 2007) where not everybody has the "Microsoft Save As PDF or XPS Add-in" installed on their workstations. I'm looking for a way to programmatically test for the presence of the add-in within an Access 2007 module.

I was using a loop through the Application.COMAddIns collection to test for the presence of the "Adobe PDFMaker Office COM Addin" but that no longer works when Adobe Acrobat is removed from the machine.

View 4 Replies

.net And Jemter Testing?

May 17, 2012

In my project developed for using asp.net with vb.net coding. Now we need to performace testing using the Jmeter tool. we can't able to test because in my application lot of session variable used, Jmeter tool does not support session variables i think.Check with debugging:1.Assign the session(userName) ="abc" then goes to next page, then check value same session vaule as nothing.

View 1 Replies

How To Do Equality Testing

Jan 18, 2012

I have a Do loop that I want to exit once it goes through without making any changes to an object I created. I figured the best way to do this was to create a temporary copy of the object at the beginning of the loop and then compare that to the actual object at the end of the loop to determine whether any changes were made to it. The problem occurs when variables are accessed and copied by reference. I have tried to use some of the methods such as .Clone and .Equals (maybe I shouldn't be using these, but I didn't see any better built-in methods), but I seem to be doing some stuff wrong. Can somebody give me an example of a good way to copy an object for later equality testing, and how to do the equality testing?

View 5 Replies

IDE :: Testing VB DLLs In VB?

Nov 22, 2010

I was once a VB 6 expert, but it's been a while.I am attempting to create a simple DLL in VB. I created a new WCF Service Library, which is what it looks like I needed to do. I filled out the interface and implemented it. Here's the interface:

<ServiceContract()>
Public Interface AgileApi
<OperationContract()>

[code]....

And attempted to call it, but I get System.EntryPointNotFoundException. I've tried pathing the defined library and copying the dll file into the same place where my EXE is, but no change to the error.

View 6 Replies

Testing An UnhandledException

Aug 26, 2010

I'm writing a piece of code to manage the Unhandled exceptions in my VB application.

I'm using the following code

Partial Friend Class MyApplication
Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles

[Code]....

View 1 Replies

Testing For FileExists In VB 6.5

Jun 4, 2009

I'm trying to determine if a file "G:myfilesfile1.txt" exists. Using sample code from numerous web searches I can't make any of the FileSystemObjects work. Seems to me the FSO routines are an add-in to VB. If this is so, how do I add them in?

In noncode, this is what I really want to do:

if "file1.txt" exists AND "file2.txt" exists
if "file1.txt" filedate > "file2.txt" filedate
copy "file2.txt" to "fileold.txt"

[Code].....

View 2 Replies

Testing For Null Value?

Aug 13, 2011

when I try to test for a null value using the following:

If not string.isnullorempty(trvlitreadservice.itineraryinfo.reservationitems(zbook).value) then .........

I get an error as soon as it hits a null value. I thought this was supposed to test for a null value yet it throws an error for the very thing I'm testing for.

View 13 Replies

Testing For Time-of-day?

Oct 1, 2011

Private Sub CompareTime3()
Dim NowTime3 As Date
Nowtime3 = (TimeOfDay)

[code].....

In each of the two test sub routines, both if-then statements end up as true and I get both messages boxes displayed ("Timeslot is 16" then "Timeslot is 40" are displayed. One comaprison is AM the other is PM. How can one variable be true for both?

View 8 Replies

Testing In Under Windows 7?

Nov 25, 2009

When i try to run my unit tests in vb.net, visual studio closes down because of an error.I don't know what is causing the problem but i is very frustrating.I have a project running for school that i can't continue because of this problem.When i had visual studio installed under windows vista i didn't got that problem. (same version of visual studio)

View 8 Replies

Testing The .NET Timers?

Apr 25, 2010

Public Class Form1
Dim SW As New Stopwatch
Dim MS As New MenuStrip
Dim Btn As New ToolStripButton

[code]....

View 1 Replies

.net - Static DateTime For Testing?

Dec 11, 2009

We have a DateTime Service that pulls the Database date down when we need to use a Date. Now, If I want to run a test using "Todays" Date using FitNesse, What would be the easiest way of creating a way to have (OurService).CurrentDate be static? We have a control that ads Days,Years, or Months to the current date.. and I would like to be able to test this.

View 1 Replies

Developing A Unit Testing API?

Dec 29, 2010

I have been assigned a task of exploring unit testing using tools available in the market.My question is how do i write an API that would help in writing unit test cases.Example i can use nunit to write something like this to check whether file exists in the given location.

<Test()> _
Public Sub CheckOutputFileInfo()
ReportPath = "D:temp est.txt"

[code].....

View 3 Replies

How To Auto-mated Testing Using Vb

Nov 6, 2011

i need to learn how to do automated testing using visual basic. i already know little bit about visual basic. now how can i do automated testing using vb.any good resource to study about that? even if it a link based resource also fine. and i need your suggestion on how to carry on with testing in visual basic and how to do it well. waiting for your reply.

View 2 Replies

Speed Up The Unit Testing?

Aug 29, 2009

In the project that i;m currently working on i;m not allowed to touch GUI for anyreason that includes program testing. I'm in bit of s frustration becuase prior to this all must application were developed and tested using GUI. Typicvally it wold take a me a week to develop an app now it taking more than that. Especially the TDD with Unit testing. The documentation kills more time too......

View 4 Replies

Sql - .NET, Testing If A Dataset Contains Rows?

Feb 21, 2010

how can I test if a dataset has rows? I'm trying to see if my sql procedure call managed to fill up my dataset.Also, is there an easy way to print the rows to a label?

View 3 Replies

Testing - Are There BDD / TDD Tools For Developing

Oct 28, 2009

I am responsible for rewriting an internal tool for my company. I am currently reworking the most time consuming step to run faster which should give me time to re-think the design of the application for a full rewrite as the interstitial version will meet the current needs. I really want to take this opportunity to implement this code using BDD/TDD but I am new to this method of programming in general and especially within the context of .NET. Are there BDD/TDD tools available for .NET? What resources should I look at?

View 2 Replies

Testing A Mail Server?

Aug 1, 2009

I often get calls from a friend of mine's company saying "ahhh our email is not working!". I thought I could write a program that would test a few things that they could run and have easy answers to my questions when they call. Things like "Is your internet connection alive?", "can you send mail but not receive it?", etc.

[Code]...

View 11 Replies

Testing A Windows Service?

May 15, 2012

1. when testing a service, should I install the exe which is in the bin subfolder or the obj subfolder, and why?

2. when distributing the service, should I use the exe which is in the bin subfolder or the obj subfolder, and why?

View 3 Replies

Testing COM Callable Assembly?

Jul 13, 2009

I have created a COM callable assembly which consists of an Interface, a single class which implements the interface. In this case the implementation is a single method.I have registered the assembly, created a type library and added the assembly to the GAC.I thought about opening an Office application like WORD or EXCEL 2003 and trying it from there but beyong referencing the COM assembly I have no idea how to code it.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved