Idatareaders Not Returning Values From Database?

May 25, 2010

In my codebehind I have this vb:

Dim reader as idatareader = includes.SelectDepartmentID(PageID)
While reader.Read
Did = reader("departmentid")

[Code].....

No Errors are being presented yet nothing is being returned by the reader. Is there an error in my code?

View 2 Replies


ADVERTISEMENT

Class Not Returning Values?

Oct 15, 2010

i have this class that i'm calling from a telerik report. when debugging asp.net application the report shows the right results but when i deploy to IIS it just return the first row and not the SUM of the salary variable.

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data

[code]....

View 2 Replies

Code Returning Different Values ( C# And .NET )

Dec 2, 2010

VB.NET Code:

Module Module1
Sub Main()
Dim x, y As Single
x = 0 + (512 / 2 - 407) / 256 * 192 * -1

[code].....

returns 0: 0

View 2 Replies

IDE :: Returning An Array Values?

Dec 1, 2009

i have this code:

...
Dim Labels() As String
Dim Count As Integer
Count = 0

[code].....

View 3 Replies

Returning One Or More Values From A Function?

Apr 20, 2010

Is it possible to return more than one value from a function? Like two integers, or an integer and a boolean, or any other data type combination. I understand I could use a sub and set these values in a variable but I was wondering if I could avoid declaring more variables by using a function.

View 28 Replies

Returning Values In Another Class?

Jul 31, 2009

I'm making this game where there is an enemy that goes to the center of the form and grabs an object and brings it back to the side. I made a new class called enemy that makes the enemy. in the class there is a sub called start which the enemy goes to the center and brings the object back. when the enemy comes back with the object i want the integer lives to subtract 1 from it. so i put the

If Not Rect.IntersectsWith(Form1.ClientRectangle) Then
Form1.Lives -= 1
End If

where Rect is the enemy's bounds. when ever rect is not intersecting with the forms bounds (which means when its off screen) lives should subtract 1, but it doesnt.

View 5 Replies

.net - Inherited Classes Returning Different Values?

Jun 25, 2010

This is more of a conceptual question than anything.

I have a base class called "RawReader".

It sets up the framework for classes to inherit it and read in specific data systems.

For example, I want an app read in a known format of FoxPro database, a CSV file, or a SQL database (there is about 8 more formats currently), then transfer it over a webservice and create a SQL database from it.

I have everything working with CSV, FoxPro, Access, Excel, etc... Easy enough.

The classes that inherit RawReader, like RawCSV, RawFoxPro, RawAccess all return a struct that contains a dataset as one of the members. The dataset contains the data from the raw system. The webservice receives this struct and creates sql tables and loads the data into it. This has already been coded and works great.

My issue now comes to reading in SQL. Obviously, I could follow the same path, read the remote SQL DB into a dataset, transfer the dataset as above, etc... My "issue" comes in where I feel like it doesnt make much sense to transfer a SQL db to a dataset, transfer it through the webservice, and then try to programmatically recreate the SQL database. I feel like I lose a lot of the granular details from the SQL database (field sizes, extended info, etc..) It seems easier in practice to just create a backup of the database, convert it to a stream object and transfer the backup over to the webservice. But this is where the problem lies...

Since all of the classes inherit from the base class, they are set up to return a DataSet. The hack-ish way would be to just add a stream object to the return struct and in my webservice add other code to make a special case for SQL sources, but I was trying to avoid that.

Any thoughts on the "proper" way to go about something like this?

View 1 Replies

Class Not Returning Accurate Values?

Oct 15, 2010

look at this class and say why it's just returning just the first row in the second query, the issue is that the Salary is showing the right value when debugging, but when deployed to IIS it's just returning the 1st row

Imports System
Imports System.Collections
Imports System.ComponentModel

[Code].....

View 1 Replies

Function Is Not Returning Correct Values

Jun 18, 2009

Ok simply my code doesnt want to output the correct number. I'm working on the project euler probems to expand my knowledge in VB.net and the current question I am working on is asking to work with triangle numbers. while researching I found that a triangle number can be calculated by using the formula:

[Code]....

View 5 Replies

Returning Multiple Values From Function

Mar 17, 2009

I am working on a project I would like to use a function in a class I created to return multiple values in order to populate a listbox. I wanted to use a do until loop to achieve this. I will just post a simplified example of what I am doing :

Public Function Listboxfiller
Dim astring As String = "This is a string"
Dim Counter as integer = 0
Do until Counter = 5
return astring
Counter += 1
Loop

Then on the form I would do something like :
lstListbox.Items.Add(Myclass.Listboxfiller)

What happens right now is that the listbox only gets the first value, when I ran through in debug mode I found the loop only runs once, even though it should go multiple times.

View 4 Replies

WCF Service Not Returning Current Values?

Sep 27, 2009

I created a WCF Service running as a console application. It is doing event listening for my workflow engine.The second application I am trying to do is a WinForm that can monitor the service and return me back the current states of the engine's workersI am able to connect to the service fine, and I verified that my service has values being set when I step through it... however when my monitor makes a call to the service, I am returning values as though it is not being run? (So default values, not current values

View 13 Replies

Web Services And Returning Multiple Values

Jan 14, 2009

I am struggling here with introducing web services into a site I am currently working on. The background is as follows.

- I have a page switchboard.vb which will recieves incoming xml requests.
- I parse these xml requests extracting its values, then setting them equal to the relevant global variables in switchboard.vb.
- One of these variables will determine a 'requestType'. Based on this requestType I want the page to call particular web services that I will add.
- These web services will then validate the user calling has permissions to access and execute it.
- The switchboard.vb page will then generate an xml respose which will post to the client.

Here is a summary of the process
getXML()
parseXML()
determineRequestType()
executeRequest()
rebuildXML()
postXML()

The ways I can see to do this are:
1. Pass the variables into the required Function allowing it to pass back a pre formatted xml string.
Pro: Simple
Con: It is not really using the web service as it should be.

2. Pass the variables into the required Function as 'ByRef' values hense changing the original value on switchboard.vb
Pro: allows me to format the outgoing xml on switchboard.vb and gives me more functionality with more individual variables as opposed to one string being passed back.
Con: Is this taking advantage of a web service? When I tried this the web service form didnt give options to input test data. Possibly because I am using ByRef?

View 10 Replies

Returning Multiple Values From A Function Call?

Apr 1, 2010

I have an active directory search function:

Function GetAdInfo(ByVal ADDN As String, ByVal ADCommonName As String, ByVal ADGivenName As String, ByVal ADStaffNum As String, ByVal ADEmail As String, ByVal ADDescription As String, ByVal ADTelephone As String, ByVal ADOffice As String, ByVal ADEmployeeID As String) As

[code].....

View 1 Replies

Asp.net - Returning Multiple Values From A Function In An Parcial Class In VB?

Sep 6, 2011

show me how to return multiple values from a function? I have my function in a seperate file within App_Code and here it is:Public Function GetQuoteStatus(ByVal QuoteID As String) As String

Dim quoteStatus As String
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Try
con.ConnectionString = ConfigurationManager.AppSettings("quotingSystemConnectionString")
con.Open()

[Code]...

However this is all good and well for one returned value but what If I wanted to return multiple values.How do I access them?

View 3 Replies

SQL Possibly Not Returning Values For A Query In Visual Basic?

Jun 29, 2010

In my code I enter a string in a text box and have the query check the server for the entry. If it exists it returns the string and the date into two separate variables. The database only has TrackingNumber and Date. Below is the code. As of right now i get "Invalid attempt to read when no data is present." at the "If (sdr("TrackingNumber") IsNot Nothing) Then" line.

Public Function CreateSqlParameter(ByVal name As String, ByVal dbType As DbType, ByVal direction As ParameterDirection, ByVal value As Object) As SqlParameter
Dim parameter As SqlParameter = New SqlParameter()

[Code]....

View 3 Replies

VS 2010 - Reading Text File And Returning Values To Textbox

Apr 17, 2011

I've a got a homework assignment that chooses one of four values in a list box, stores it in a text file. Secondly, on the display click event it should access the text file, read the line, store it in a variable and then display the totals in a text box. Works sort of fine except that it doesn't display the totals correctly. Code for both buttons is below. The variable are assigned in the mainform (Tried also in the display button and didn't change anything). The save button works fine and stores fine in the text file, it's just the reading that's the problem.

Private Sub saveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles saveButton.Click
'save the new vote choices to a file
Dim votes As IO.StreamWriter
votes = IO.File.AppendText("votes.txt")
Dim voteSelected As String = CStr(commercialListBox.SelectedIndex)
[Code] .....

View 2 Replies

Compare Values In Datagridview With Values In Database Before Inserting Into Database

Dec 15, 2010

I am building VB.NET application that takes data from text files that are exported from a legacy DOS program. These are written to a datatable and displayed in a datagridview. Right now my code simply loops through the datagridview and inserts the data into the database (SQL Server). There is a requirement now that the client number must be checked before the insert to see if it exists in the database. If it does, then the value of one field (tax rate) is checked against the value of the field in the datagridview. If there is a difference, then the rate is to be updated in the database and the data that was in the database is to be written to a history table for audit purposes. If the client number is not there, then we are to do the insert (which is already written). I want to know what is the most elegant and efficient solution for this problem.

I need to compare what is in the database table with what is in the datagridview, update the history table for records that exist, and then insert new records.

View 2 Replies

DB/Reporting :: Returning Data In A Database?

Mar 4, 2010

I would like to return the data in a database query as an array, but the problem is, Im having trouble working out how to do it, here is how I would like the data to be returned:

array (
---> 1
---> ---> 1
---> ---> ---> fieldname

[code]....

I could create a multi dimentional array, but the results could range from 2 rows, to 2000 rows, I looked into redim, but you can only redim the last dimention, I would need to the first and second, but not the last.

View 2 Replies

Searching A Database And Returning Results In A VB Form

Mar 30, 2009

I have a problem which I have tried to solve in several ways, and by searching the Internet for various terms, searching through books and Visual Basic instructional videos, but none have yielded the correct results. My goal is as follows:

1. Create a Database listing job names, job numbers, and a link to the file about the job.

2. Create a form with 2 text boxes, a search button, a box to display results, and a preview panel.

The two above steps have been completed. The following is where I get stuck

3. I want to search for either the job name, and/or the job number, have VB search through the database and return the results in the results box.

4. On clicking on one of the results in the result box, the preview panel will show a preview of the file.

Notes:
i) The files being linked top are Microsoft Excel files.

ii) The box I have used for the results currently is a listbox, though I've no idea if this is the correct choice for what I want to do.

iii) The database I created is an *.xml database created in Visual Basic. I am a fair beginner to VB, learning as I go, but I'm stumped as to how to achieve this so any pointers on how to achieve points 3 or 4

View 2 Replies

Server.htmlDecode() Returning A JSON String From Database

May 2, 2012

I have created a function which essentially enables me to output anything I need from my database in a similar method to Facebook's FQL querying method as a JSON text result. I can also use the same function to get the output as a Dictionary, or List of(Dictionary) to use with VB functions for other purposes.

[Code]...

View 1 Replies

Asp.net - Returning In Oracle INSERT Is Not Returning Proper Value?

Mar 15, 2012

I have an ASP.NET web application (VB.NET) using an Oracle database. On an insert, I need to get the identity of the inserted row back. I am trying to use RETURNING, but I keep getting a value of 1 returned.

Dim strInsert As String = "INSERT INTO L.TRANSACTIONS (LOCATION_KEY, TRANS_CREATOR, TRANS_EMAIL, TRANS_PHONE) VALUES (:location_key, :trans_creator, :trans_email, :trans_phone) RETURNING TRANS_ID INTO :ukey"

[Code].....

View 2 Replies

Xml - Mix Values From Local Data With Values Returned From Database While Using LINQ To SQL?

Oct 27, 2010

I am creating an xml file with LINQ as follows...

Public Sub CreateXml()
Dim db As New MDataContext
Dim Customers = <gallery columns="3" rows="3">

[code]....

Could i mix local values with the ones returned from the LINQ query...Something like the following?

Public Sub CreateXml(ByVal **Col** As String, ByVal **Row** As String)
Dim db As New MDataContext
Dim Customers = <gallery columns="& **Col** &" rows="& **Row** &">

[code]...

View 1 Replies

Returning A Function Vs. Returning Variable Name?

Dec 12, 2011

My brain may just be fried since it's the end of the semester, but my teacher kicked this back to fix and resubmit...she said that I am "returning the name of your function rather than your variable name".

Here is my code for all 3 forms.

code:

These are forms to calculate the cost of getting a cell phone package.

View 6 Replies

Database Error - Application When Installed, Doesn't Read Values From Database?

Jul 20, 2011

When I install my application, some forms are unable to connect to the database.

I say some because, when my login form works totally fine. Authentication happens.

But once I go into the main application, and open other windows, I start to get these error mesages:

[URL]

View 4 Replies

Database Sql Server Compact Edition 2005 - Save In A Database - Column Cannot Contain Null Values

Oct 15, 2009

Ive created one database Sql Server Compact Edition 2005, with one table ("Cliente") I know that I can created my database good, but i have a problem saving information since three textbox, in my table(With columns "Nombre" "Apellido" "Cliente". In my form there is a button save ("Guardar"). When I do click in my button appear the next message : "The column cannot contain null values. [ Column name = Nombre,Table name = Cliente ] " and happen the same with apellido and Id_Cliente. And this happen becouse my code cant save the information....

This is the code

Option Explicit On
Option Strict On

Imports System
Imports System.IO
Imports System.Data

[CODE]...

And the code for my button is:

Private Sub cmdguardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdguardar.Click

Dim myconnection As SqlCeConnection
Dim mycommand As SqlCeCommand

[CODE]...

View 2 Replies

Database Update - Using OleDbDataAdapter To Insert New Values To Access Database

Jun 6, 2010

I created a dataset and i am using OleDbDataAdapter to insert new values to access database. But when i close the program and after open it, values are not in the database. How can i solve this problem? Also, i have another problem. When i write codes that

[Code]...

View 4 Replies

User To Connect To SQL Database And Edit Some Of The Database Values?

Jul 2, 2011

I'm working on a tool that allows the user to connect to his SQL database and edit some of the database values.First here's a screenshot of the GUI (you can see my problem as well):

[Code]...

View 2 Replies

Getting Values From 2 Database?

Mar 14, 2010

My Problem is we have two database. One for current year and one for last year.I have to get the sales values of this year and sales value of last year. The form i need is

WORLD LastYear_Sales CurrentYear_Sales
world 1 143124 65544
world 2 5635634 6666543
world 3 0 876876

now i will explain, world 3 is not in last year database, it is introduced in current year, so its value must be 0. I tried to union 2 queries, but its not showing correct.

View 2 Replies

Not All Values Being Sent To Database

Dec 13, 2010

Here is part of my [code]...

Here is my problem. My controls on the form were created from dragging and dropping one of my tables from the data explorer window onto the form in details form, not gridview. Amongst these controls are four comboboxes whose text properties are databound, but their items lists are not bound. When I click my submit button, all the data is sent to the database except the text from these four comboboxes. I have looked everywhere I can think of and can't figure out why the text from those comboboxes isn't being updated in the db.

View 6 Replies

Add Listbox Values To Database?

Apr 1, 2010

The following is the code that i used to store all the values in the listbox ito the access database.but it is not working.I didn't get any error.but the values in the listbox is not being stored in the database.The field in sample table that stores the value from listbox is a multivalue field.[code]...

View 2 Replies







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