Single Data Type ?
Jun 22, 2009I have a single data type, and when debugging, I found the value of this data type is -1.#IND
What is that -1.#IND?
I have a single data type, and when debugging, I found the value of this data type is -1.#IND
What is that -1.#IND?
For each column in data table i want to add parameter with same data type as column data type. But looks it's not that simple.
Dim cmd As New SqlCommand
Dim dType As New System.Data.SqlDbType
For Each cl As DataColumn In DataTable1.Columns
[CODE]...
How can I do this?
I need to create a function which have either 1 parameter with a string as data type or 2 parameters with double as data type.Something like the substring method.
View 2 RepliesI'v designed a ms access database table with one field having Datetime datatype. I can Insert data into it from vb.net front end by trns_dt DateTime.Now.DateBut when I fetch records from the tableand assign the dataset datasource as da, it shows datatype mismatch error.
daleDbDataAdapter("SelectDaily_Transactiondtp_from_dt.value dtp_To.value con)
dsDataSet
[code].....
Is there any box type in vb.net that is multi lined, however stays as a single line and when you click on it , it will open up into a multi lined box (because I want 10 of them in a small area , in single lines will be perfect but needs to have lots of information stored in each one) and then when the user clicks out of the box / into the next one, it returns to its single lined state?
View 8 Repliesconnect with same type 2 servers on different destination from single client
View 8 RepliesI have a program that calculates commission, but if the commission is nothing then I do not want it to show a zero commission. I want a message box to show a message that there is no commission earned.
View 1 RepliesI have the following Data Transfer Objects defined:
Public Class MemberWithAddressesDTO
Public Property Member_PK As Integer
Public Property Firstname As String
Public Property DefaultAddress As AddressDTO
Public Property Addresses As IQueryable(Of AddressDTO)
End Class
[Code]...
I have to connect same type of remote objects on different destination using .net remoting. For example, I have a database access middle layer on a remote server and local server. But both are same type object. but the remote destination addresses are different. So how to connect it using .NET Remoting?
View 1 RepliesOk, just needing a 2nd set of eyes looking at this to make sure the error isn't something else other than my LINQ code here. Here's the function class itself:
Public Function GetJacketByPolicyID(ByVal jacketID As Int32) As tblPolicy
Dim db As New DEVDataContext()
Dim j As tblPolicy = db.tblPolicies.Single(Function(p) p.policyNumber = jacketID)
Return j
End Function
and here is the code which calls this class function in the web control form itself:
Dim p As tblPolicy
Dim j As New Jackets()
p = j.GetJacketByPolicyID(3000050)
For some reason it's flagging the 2nd line in the GetJacketByPolicyID function saying the specified cast is not valid. So I'm guessing it's something I'm doing wrong. I'm sure the tblPolicy/tblPolicies class works right since I can create a new instance of a tblPolicy and set a few variables by hand and return it, so that's not it. I've also checked the datarow I'm fetching and there's no null values in the record, so that shouldn't be it either.
My colleague gave me a DLL that manage all database business. I wanted to invoke a function that uses Stored Procedure and return the search result. In the function receive a parameter type in ystem.Data.IDataParameter[]. Below is my codes.
[Code]...
I got 2 classes in a form, and I would like to pass a value from a textbox to the other class, so I decided to use Deligate.
Below is the code.
Public Delegate Sub delPassSize(ByVal text As TextBox)
'To get size from Class Calculate(Class 2)
Public Sub GetSize(ByVal txtForm1 As TextBox)
[code]....
and the error message is 'cls.Getsize is a delegate type and requires a single 'addressof' expression as the only argument to the constructor.'
I have a function (on vb.net) to get a data from a XMLWebService:
[Code]...
I added this lines in the form load of DataGridPrinter by Merrion in the codebank..[code]Unable to cast object of type 'System.Data.DataViewManager' to type 'System.Data.DataTable'.
View 2 Repliesevery time i run this code i get the same error
Unable to cast object of type 'System.Data.DataTable' to type 'System.Data.DataView'.
the code is
Dim plmExcelCon As New System.Data.OleDb.OleDbConnection
Dim cmdLoadExcel As System.Data.OleDb.OleDbDataAdapter
Dim PrmPathExcelFile As String
[Code]......
In VB.NET I would like to create a complicated data structure with multiple types of data stored in an array like format (see below). I am trying to create a data structure that would look something like this: [Name; xLoc; yLoc; zLoc; [Jagged Array]] Note: Name needs to be dimensioned as a string, xLoc and so forth as integers. The Jagged Array would look like this:
[Code]...
I have an Address Book project with a listbox. The listbox is bound to the database via the little arrow pop-up box in the corner of the listbox. I have the DisplayMember set to FirstName, and obviously only display the First Name of the contact in the ListBox. Is there an easy way to change it so that it displays the First and Last names? I can't change the binding because I need it to get the ID of the record selected.Here's the basis of my code...
Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CompanyDataSet.Contacts' table. You can move,
[code].....
[code] "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.The statement has been terminated." [code]
View 6 RepliesBasically, our users enter values onto a spreadsheet and I have been asked make the spreadsheet output to a CSV file preferably each one completed appears as a single line in the CSV.Upon examining the spreadsheet, I cannot figure out the best way of acheiving this, or if it is easily acheivable in the first place.I have attached an example of the spreadsheet data, to give it some context the spreadsheet records times that carers have visited a client, which can happen many times a day over many days per week, there is also a yes/no for each day on the sleepin.
View 5 RepliesI have one question. i have seen some codes like:
Req = CType(System.Net.HttpWebRequest.Create("url"), Net.HttpWebRequest)
Is it really necessary to cast the same type, or is there a difference when its not casted.
I have a number of controls (Device1, Device2, etc.) that all inherit from BaseDeviceControl. In the DragEnter event handler I am trying to test for the correct type by using the BaseDevvceControl like this....
[Code]....
I am pulling data from a local MSSQL database using a stored procedure, then send the data to a web service. Every part of the component works well except for a pesky problem will a DBNull being returned from the DataRow field, when I know that the field is not null and has valid data. The database and associated INSERT statements that add to this field are designed to not allow NULL entries. When I debug break the program on or right before the line that throws the error I see that the field has valid data for the current row.If I add a null check to the code (as below) the operation continues as normal:
Dim dataResultsTable = Me.myViewTableAdapter.GetData(int)
For Each myDataRow In dataResultsTable.Rows
If worker.CancellationPending Then
[code]....
Why is the read operation returning DBNull instead of the data in the database?
EDIT: Just to be clear, the operation does return the proper data, but the data is not being saved into the variable.
<ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding Path={x:Static vmc:clsPersonViewModel.ChildrenPath}, Mode=OneWay}">
<ItemsControl.ItemTemplate>
[Code].....
In the code above, if there are no children (the ChildrenPath property returns NULL), nothing is rendered in the view. In the code below, when ChildrenDataSetPath is NULL the XamDataGrid still gets rendered. How do I achieve the same for a single object (as opposed to a collection) as the datacontext?
<DataTemplate DataType="{x:Type vmb:clsPersonViewModel}">
<igDP:XamDataGrid DataSource="{Binding Path={x:Static vmb:clsPersonViewModel.ChildrenDataSetPath}}">
[Code].....
Why am I getting that error message? This is the code which it's happening to:
Public Class frmford
Dim LoanAmount, InitialPrice, Make, TradeIn, OriginationFee, DepositAmount, Model, Options, AirConditioningTax, GST, PST, Total, Subtotal, APR, Months, RoofRack, SunRoof, SideAirBags, TintedGlass, RearSpoiler, GPS, PowerLocks, FreightAndPDI,
[Code]....
I tried to Dim those variables as double and it didn't work either.
I have already completed most of the program and it works, except when there is no input in the Fahrenhiet or is left blank.I get the following exception: on this code: Inputsingle = CSng(TextBox1.Text).Conversion from string "" to type 'Single' is not valid.Here is my code:
'Project" Convert Tempertures
'Progammer: Cathy R. Hjelm
'Description: Convert Fahrenheit temperture to Centigrade Temperature using a convert button and output Text Box[code]....
I have an InvalidCastException Error in my program. The program is that i try to insert an employee record into a database table after getting the details from a form. I've used Money data type is SQL Server for salary and SqlTypes.SqlDecimal data type in employee template class. i've used a stored procedure to pass the values and i add the basic value by passing a parameter by the method
Dim prm8 As SqlParameter = com.Parameters.Add("@basic", SqlDbType.Money)
prm8.Direction = ParameterDirection.Input
prm8.Value = emp.Bsc
I've used the money datatype itself even in the stored procedure variable.I get the following error.
failed to convert parameter value from sql decimal to decimal
Even if i use
prm8.Value = Convert.ToDecimal(emp.Bsc)
I get an error Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible'.
I am getting this error when I am tring to load string type to data table)
Using connection As New SqlConnection("connectionstring;")
connection.Open()
Using Command As New SqlCommand("SELECT ClientId,forename,surname from t_clientdetails
[code].....
I get the below error Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.This is the code I'm using
Dim str As String = String.Empty
If (Session("Brief") IsNot Nothing) Then
Dim dt As DataTable = Session("Brief")
If (dt.Rows.Count > 0) Then
[code]....
I have the following VB.NET code to set and read objects in cache on a per user basis (i.e. a bit like session)
Public Shared Sub CacheSet(ByVal Key As String, ByVal Value As Object)
Dim userID As String = HttpContext.Current.User.Identity.Name
HttpContext.Current.Cache(Key & "_" & userID) = Value
End Sub
[Code]....
I use these functions to hold user data that I don't want to access the DB for all the time. However, when the data is updated, I want the cached item to be removed so it get created again.
How do I make an Item I set disappear or set it to NOTHING or NULL?
I'm writing an app to print a list of beers that are currently on tap at the restaurant where I work part-time. We have 29 taps and dozens of different beers. I have 2 tables in a database (one with the "master list" of all the beers and an "on tap" one with one entry per tap). Each database entry includes fields for name, brewer, location, style and ABV. So far I've made a GUI with 29 combo boxes (one for each tap) and 2 buttons (one that opens a dialog box to modify the "master list" and one to print the list). The idea was to make it as simple as possible since the people who use it aren't great with computers and are often in a hurry.
Each combo box drops down the whole master list of beers and I'd like for the selected beer to be written to the corresponding index in the "on tap" table. My idea is to then extract the data from the "on tap" table and print it. I haven't done any coding yet, really, just drag-and-drop.It's frustrating since I know how I'd do the back end in C or C++, but not in VB. The reverse is true for the GUI.