Combining Two Conditions In One Section?

Jun 21, 2010

How to combine these two conditions in one section
Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles DataGridView1.CellValidating
'condition 1
' check given value is numeric or charactr type
If e.ColumnIndex = 3 Then
If Not IsNumeric(e.FormattedValue) Then
DataGridView1.Rows(e.RowIndex).ErrorText = " must be a numeric value"
[Code] .....
'condition 2
' check given value is greater than 0 or not
If e.ColumnIndex = 3 Then
If (e.FormattedValue.ToString = "0") Then
[Code] .....

View 2 Replies


ADVERTISEMENT

.net 4.0 - ASP.NET 4.0 Custom Configuration Section: "An Error Occurred Creating The Configuration Section Handler"

May 2, 2012

I am creating a custom config section that will allow me to manage what ELMAH exceptions I want to ignore from my VB.NET/ASP.NET app. Here's my code. I made it easy to paste in a blank code file if anyone's up to the challenge of diagnosing the problem.

CODE:

When I execute this code:

CODE:

I get the error An error occurred creating the configuration section handler for IgnoredExceptionSection: Could not load file or assembly 'WEB' or one of its dependencies..

What boggles my mind is that this all works fine in my C# console test app after I convert the code from VB.NET using a web utility. However, when I paste the VB code from my web app into my VB.NET console test app, it doesn't work there, either, so it appears to be a C#/VB issue. What am I doing wrong here?

View 1 Replies

Combining Two Wav Files?

Aug 18, 2010

i have to combine 2 wav files in my project.

View 1 Replies

Drawbacks Of Combining C# And .NET?

Apr 28, 2012

I'm a long time VB.NET developer and has recently switched to C#. I found out that some of the built-in VB.NET functions (which predates .NET back to 6.0 and BASIC itself) such as the String.Left, or Right, or advanced functions like saving to the registry (SaveSettings and GetSettings) are noticeably absent. What I did was create a new project in the same solution with VB.NET as its language and recreate basically all the functions I need that are available in VB.NET. And then I just call that to the C# code I'm writing.Since compiling the code in .NET pretty much boils down to the same CIL, it shouldn't matter performance-wise what language I wrote the code in or whether I mix C# with VB.

View 4 Replies

Asp.net Mvc - Combining Extension Methods?

Sep 5, 2009

I'm trying to write 2 extension methods to handle Enum types.One to use the description attribute to give some better explanation to the enum options and a second method to list the enum options and their description to use in a selectlist or some kind of collection.You can read my code up to now here:

<Extension()> _
Public Function ToDescriptionString(ByVal en As System.Enum) As String
Dim type As Type = en.GetType
Dim entries() As String = en.ToString().Split(","c)

[code]....

So my problem is both extension methods don't work that well together. The methods that converts the enum options to an ienumerable can't use the extension method to get the description.

View 1 Replies

Combining 20 Overloaded Subs Into One?

Jan 31, 2012

I'm working with a third-party library interfacing to an old database system. There's a method - CallProg that calls a "stored procedure" (for lack of a better translation - any Pick users in the crowd?). However, instead of doing something like this:

Public Sub CallProg(ProgName, ParamArray ProgArgs() As String)
...
End Sub

[code].....

View 2 Replies

Combining 3 Textbox And Dropdownlist?

Nov 11, 2009

I have 3 textbox's and 1 dropdownlist and I am trying to combine all that data into one string. Here is what I tried but is not working:

Private Sub FullAddressTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FullAddressTextBox.TextChanged
FullAddressTextBox.Text = AddressTextBox.Text & " , " & CityTextBox.Text & " , " & StateDropdown.text " , " & ZipCodeTextBox.Text
End Sub

My goal is to combine these simultaneously as whoever is filling in the data or after I hit my submit button, if so it has to occur as the first event.

I think my problem has to do with .text after the statedropdown, Is it suppose to be .tostring?

View 6 Replies

Combining DataTables Using Linq

Apr 27, 2012

I've seen several posts on the subject, but none seem to answer this particular dilemma. I have two datatables that I obtained by querying two separate servers.[code]

View 7 Replies

Combining Delegate And Template?

Dec 22, 2009

Try5Times will try a function for 5 times.that function can have any number of argument and return a boolean.

If the function return false, try again.

If the function return true, stop.

How to make such function and delegate? Is there a general delegate?

View 3 Replies

Combining Objects Into A 'for' Statement

Mar 18, 2011

im just playing around making a silly web browsing application for no reason but to look for the right code and see it i guess

well anyway is there a way for me to make a 'for' statement that does an action to a string of objects with same name but different number like:

For fame As Integer = 1 To 10
If PageLoc = fame Then
WebBrowser(fame).Navigate(TextBoxAddress.Text)
End If
Next

View 8 Replies

Combining Two .png Images Into One Image ?

Jan 5, 2011

I have two (actually many) .png images in my application. Both have transparent areas here and there.I want, in my application, to take both images, combine them, and display the result in a picture box. Later I want to save the result through a button.So far I managed to find the two images and combine them, but it seems the transparency thing won't work. I mean, if you put one image over another, only the top image is visible as the result because, apparently, the image's background is a plain white box. Which is not. Here is a bit of my code:

Dim Result As New Bitmap(96, 128)
Dim g As Graphics = Graphics.FromImage(Result)
Dim Name As String[code]....

resourcesPath is the path to my resources folder. Bases is a folder in it. And Name is the image's name.

View 2 Replies

Linq Combining 2 Queries?

Oct 11, 2010

Let's say I have 3 tables: carts, baskets and eggs where a basket can contain many eggs and where carts contain many baskets. Each basket has a foreign key that maps to a cart and each egg has a foreign key that maps to a basket.I need to return a table that contains these 3 columns:Cart Name | Count of Baskets in Cart | Count of Eggs in Cart.Each table is an EF and I'm using linq with VB.So far, I have 2 queries: one that returns the columns Cart Name and Count of Basket and another one that returns Cart Name and Count of Eggs. How can I combine these two result tables so that I get the results in one table?

Dim query1 = (From cart In myEntities.Carts
Where cart.UserID = TheUserID
Join baskets In myEntities.Baskets On baskets.CartID Equals cart.CartID

[code]...

View 2 Replies

VS 2008 Combining Two Arrays?

Jul 3, 2009

I'm trying to combine two arrays. Simply append 1 array to another. I have two string arrays. Lets just say array1 and array2.would the following be correct?

array1.Copy(array1, array2, UBound(array1)) I guess I'm slightly confused about the parameters. When I try to use the above code I get green squigglies with the following error.Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.

View 2 Replies

VS 2010 Combining The Total

Mar 7, 2011

[Code]...

this is my code right now i want to make it so that it will keep adding the total. meaning if i get an answer then get another answer i want both of them to add up and show.how can i change it so that it will do tat??

View 4 Replies

If Else Conditions Won't Work

May 10, 2009

Public Class Inventory_Edit
Private Sub Inventory_Edit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CategoryDataSet.Category' table. You can move, or remove it, as needed.
Me.CategoryTableAdapter.Fill(Me.CategoryDataSet.Category)

[URL]

I added an "edit" icon on my bindingNavigator. When users click on it, a new form will come out and pull out all the data records from the datagridview. Now the strange thing is that when I wanted to edit the data records, when I left the product name blank, I would get an error message saying "Product cannot be blank" - please see above code. But when I left the "Cost Price" blank(same applies to "Sell Price" and "Quantity"), the error message box wouldn't come out, instead, it did not allow me to move on to another textbox, close the form etc until I filled out that textbox with INTEGER. May I know why the error mesagebox would not come out when I entered the wrong datatype?

View 12 Replies

If Statement Where Both Conditions Get Used?

Oct 11, 2011

the testBoolean is set to the value True, but for some reason when debugging, it step through both conditions, so in the end the button1.visble becomes False, but I want it to be set to True.[code]....

View 14 Replies

Using Operational Conditions?

Feb 1, 2011

I am very new to vb, I know there is an error somewhere, I had an assignment which stated that if a number was < 101 or > 500 and the answer is correct the output should be, for example-123, if the answer was wrong then the message output should be wrong number <101>500. Everytime I type in a number(no matter what the number) and click on my check button I get the output message. If at all possible, can you please assist. My professor gave the following example, but I am still not getting it:

Dim strInteger As String = "52.801"
Dim dblNumber As Double
dblNumber = CDbl(strInteger)

[code].....

View 4 Replies

C# :: Combining Assignments (operator Syntax)?

Mar 1, 2011

Take a look at this VB.NET code:

list = GeoController.RegionByCountry(country, language)
Region.allByLanguage(key) = list
In C#, I could write this in one line:

[code].....

View 3 Replies

Combining Classes And Modules Into One File?

Feb 5, 2011

Is it ok to use some classes and modules inside a single VB file ?

At present, I used to create them in separate files by choosing Project menu --> Add Class/Module

I was thinking about combing them into one file. Is there any merit or demerit on this approach ?

View 6 Replies

Combining Columns Of Two Tables In One Table?

Dec 16, 2009

I am working in vb express 2008.I want to combine two tables to show all the columns of two tables in one table. I tried following query:

"Select de.Description, SUM(de.Quantity) AS Quantity, SUM(de.Amount) AS Amount " & _
"FROM DailyExpenses de " & _
"WHERE de.EDate Between @START and @END " & _

[code]....

And i want to combine two tables to display the following result into a Listview through a SQL query:

Description Quantity AmountDescription Quantity Amount
Mineral Water 12 26 Coca Cola 2 25
Rice 3 215 Sprite 3 15
Beaf 4 150 Beaf 4 50

View 6 Replies

Combining Multiple Projects Into A Single One

Apr 19, 2008

I originally developed a simple application software [VB.Net + MS Access] (Lets call this project A) but now I want to include more functionality in it. I have an encryption/ decryption software utility (Lets call this project B ) and a Text to speech generation utility(Lets call this project C) . That is, I want to add Projects B and C to project A. [Such that clicking on the main form of project A calls a form from project B or C as desired].In solution explorer, I right clicked--Add Existing Project--and added both the above mentioned projects 1 by 1. (Added B and C to the solution explorer with the already present A).As the application software's (Project A's) main form is the main form of my project, I want to have a menu option on the main form (Of Project A) so that a user could click on one of the menu options and the main form of my other projects ( Project B or Project C or Encrypt/Decrypt or Voice Generation) should open by him doing so. To this effect, I tried the following:

1. I dragged the form simply from one of the projects (From B or C ) into the folder of my Application Software (Project A).This generated a lot of Build errors and the Voice Generation utility (Prj. C) would not work like this.

2. Tried to reference a dll, however the authors of Projects B and C did not include a dll in their projects.

3. Now I came to know that to call a form residing in another project folder or even another folder within the same project, you have to give a path for the form. HOW DO WE DO THIS?

As you can understand, I cannot copy the entire code of the 3 projects here....I will try attaching my project here though..Here it is: http: rapidshare.co...MY_Prj.zip.html[Dear Administrator: The downloading option on the webpage does not allow files bigger than I mb, thts why I used an external link]As I said, in the application, Project A is TMS.NET ; Project B is EncryptFile and Project is C.I encountered a problem while adding project C [spoken word], so the project contains only projects B and A. I will try to attach project C seperately.That is, TMS contains proj A+B and Speech contains C.

View 4 Replies

Combining Objects Through Summation Of One Field Only

Aug 1, 2011

I have a set of objects that I'm returning via a Linq to SQL query. I'd like to modify the query so that I return a set of objects that are combined only when one of the fields match. The relevant columns of my Products DB table are CategoryID and Quantity. I'd like to combine the fields so that if the CategoryID is identical, the Quantity fields are summed up. However, I don't just want the sum - I need an object that has all the common fields (assume all other fields are identical for the query) so it appears as only one object of type Product. Is this possible? (I'm using VB.net - but open to solutions that include database views, partial classes, etc)

View 1 Replies

Combining Processes But Using A Common Module In .NET?

Nov 2, 2010

Here is a complicated, but possibly dumb question concerning adding projects together in the IDE in order to increase performance and share memory at the same time.I have written two distinct exe's. The first exe (file processsor) operates using three timers to perform communication between a hardware OEM proprietary ComServer and file output from the second exe. The second exe (work generator) simply outputs files on hard disk so that the "file processor" can process the commands in the order given. The first exe was written as a "background processor" to the second exe in a stand-alone fashion. There is a need to communicate data between the first and second exe that is time sensitive. The ComServer called by the "file processor" only allows one port to for communication to the hardware device that is a USB. The "file processor" is capable of extracting the data required but the existing technologies, such as RPC, IPC are too slow and or full of pitfalls. Microsoft's Memory Manger has found it easier to create multiple instances of the proprietary ComServer and assign the needed memory to the calling routine so that it can "scoot" memory easily in the garbage collection feature of the operating system. What this does is cause the mullitple instances that are created to "gang up" on the device either slowing its performance down, or causing time outs. [The second process is a custom 3-D graphical CAD/CAM. The first process is a machine interface. Although hind-sight is 20-20, it seemed more ideal to write this background or file processor independantly, as then it could communicate with existing as well as a custom CAD/CAMs.]

Simply writing the first processes' code into the second slows down the second process as a result of all the timer interrupts looking for work to do. (Mouse is squirrely, screen refresh is slow, etc.) I am only guessing here that the operating system's service of the more complicated single memory location is somehow interrupted more frequently for a larger project, than two smaller independant projects running seperately. I only know what I observer here. Interestingly, the two smaller projects running seperately seem to run fine.

Now for the dumb question. Is it possible to merge the "file processor" with the "work generator" in the IDE such that each process runs as independantly as two distinct apps, but at the same time, make it possible to share memory via one Module1.vb? So far, I cannot find a way for the "file processor" to see the "work generator's" Module1.vb, regardless of how many PUBLIC statements I issue in the code. In other words, what would be the steps after File->Add-> Existing Project to cause the "file processor" project with a form to start first, then drop to the background, followed by launching of the "work generator" second where each process shares the same Module1.vb?.

If this could be done, say through a compiler statement, or whatever; then this could make the Memory Manger folks happy, and provide for the speed required to operate real world processes? Basic computer science suggests a simple processor LD instruction could make data available to any application within a few clock ticks. Microsoft now longer allows direct memory access, or the ability to carve out a "stay resident" dll in memory where a memory location can be called for quick distribution information to all apps with just one call to a device.

View 5 Replies

Combining Several Rtf Files Into One RTB Form Control

Aug 29, 2011

I save the following six individual rtf files in my application and now would like to combine them into one RTB control on a form.

rtbC1.SaveFile(selectedfolder & "" & "FileC1.rtf")
rtbC2.SaveFile(selectedfolder & "" & "FileC2.rtf")
rtbC3.SaveFile(selectedfolder & "" & "FileC3.rtf")

[Code].....

View 11 Replies

Combining Text Boxes And Undoing Them

Mar 2, 2011

I have been working on this project for a while and this is just one more add-on. I want to be able to combine text boxes like my code below-

[Code]...

View 6 Replies

Combining Two Projects And Get A Single .sln File

Apr 19, 2012

I want to combine two projects into one i.e. image and audio steganography with a single .sln file. How do I connect them? I'm using Visual Studio 2008.

View 2 Replies

Combining Variables In SqlCeCommand Statement?

Apr 11, 2011

with the following code example:

T04Command04 = New SqlCeCommand("Update GameResults Set CN01=@T04Var02 Where Counter=@T04Var03", T04Database01)
T04Command04.Parameters.AddWithValue("@T04Var02", T04N01)
T04Command03.Parameters.Add("@T04Var03", T04ClnRec01)
T04Command04.ExecuteNonQuery()

I am trying to use two different variables in this SqlCeCommand series, to (1) update only a particular record in the database (2) with a particular variable value. However, I get the following error:

"An SqlCeParameter with ParameterName 't04var03' is not contained by this SqlCeParameterCollection."

View 2 Replies

VS 2008 Combining Csv With Combobox And Textbox

Sep 16, 2009

I'm making a program in which there is a form and when opening this form it automatically checks the internet for a csv file and reads the data from it.

the csv file consists of 2 items i need "Provider name , Provider smtp" example:
==
Chello,smtp.chello.nl
Het Net,smtp.hetnet.nl
==

I've got the part working that when the form loads the online file gets read and the data is shown in a combobox. Only it shows the whole line like 'Chello,smtp.chello.nl'.

What I want (and can't seem to get working) In only the combobox the words before the comma and in a invisible textbox the corresponding smtp line. Ergo when I select option number 4 the right smtp is put into the invisible textbox.

My code so far:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myWebClient As System.Net.WebClient = New System.Net.WebClient()

[Code]....

View 9 Replies

VS 2008 Combining Names With Listbox?

Oct 25, 2009

This next program I am working on consists of 3 listbox's. The idea is to have the end user load names in the first and second list box. Then have a button's action when pressed combines the list in listbox1 with listbox2 then gives the output combination in listbox 3.

I also wanted to include some checkbox options such as adding a "_" or "." for every item.

Here is a thinking map of how I want it to work.

Listbox 1
TOM
Listbox2

[Code].....

View 10 Replies

VS 2008 Combining Private Subs Together?

Nov 5, 2010

Probably an easy question to answer...I have 9 buttons on my form

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
etc. and all do the same thing so how can I merge them into the same sub so i don't have to copy and paste a bunch?

View 4 Replies







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