If I send a String set to Nothing as an input parameter to a SQL stored procedure, and in the sproc it's like this @MyString Char(9) = NULL, what does it turn NULL into? Because I'm firing the sproc and it's not firing the statement that says IF @MyString = NULL... So I don't know what it is... Or how can I pass the string as a NULL if nothing is passed as a parameter to my calling function?
I want to pass a List of T where T is an object I've created that has about ten properties (strings, dates and integers).The lst passes to the function successfully. I am also passing an New T of the Object (itm as T).I can see all the values (see image below), but because it's generic I cannot seem to retrieve the property values and I cannot figure out how to iterate through the properties of each itm as they are retrieved in the For Each.[code]
I'm learning to use this program and I'm a few weeks into learning it and I'm understanding most of it fine, but I just cannot get a grasp on when to use CDbl, CInt, CStr etc. functions. Here's an example of a few lines of code I can't get a grasp of:
If IsNumeric(txtFirst.Text) And IsNumeric(txtSecond.Text) Then txtSum.Text = CStr(CDbl(txtFirst.Text) + CDbl(txtSecond.Text))
This program is supposed to take 2 numbers that are inputted by the user and add them together. simple. I was playing around with it, and I took out the CDbl and CStr functions, and the 2 numbers that were supposed to be added together were only added side by side (ex. If I input 2 and 15 as my numbers it would spit out 215).
So I'm curious when to use these functions.
My first nagging question is, how come on the second line, it says CStr(CDbl(? Why would I need to convert to double, THEN to string? which is my understanding, unless I am reading this wrong.
Another question I have is, if I declare var1 as Dim var1 as Double I constantly see the next line as var1 = CDbl(txtbox.text) and so on. I don't understand why we need to convert to Double here, since when I declared the variable as a double, it should already be in a double form already, shouldn't it?
I just want to know, what exactly the difference between the functions CStr() and Str() and also the .ToString()? With the code provided below, what's the difference between the three?
I've mainly been recording keystrok macros... I created visual basic code that allows the user of a template to hide table gridlines - which works fine. The code to show gridlines does not work if the table has only one row. Here is the code - it is getting "stuck" on the .LineWidth = wd
LineWidth050pt for a horizontal border, as there isn't one. I don't know how to change the code to not execute the command if a horizontal border line does not exist.
With Selection.tables(1) With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = 5592405 [Code] .....
How can I get this to display in currency format. Righ now it's coming out with the right math but only carrying one decimal place and I get no dollar sign.[code]
I am trying to create a treeview in VB.net, the data has to be loaded from MSAccess 2010 database. When I try to run this program I get error : Argument Null Exception was unhandled, 'column' argument cannot be null and the program crashes. I have pasted the code as under:
Imports System.Data.OleDb Public Class frmRating Private Sub frmRating_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
When ever I try to update a record from data grid using a dataAdapter record it always showing ' update requires a valid insert command when passed data row collection with new rows' From specific sql server Table only. Resulting me holding up a project.
when the program is already save the data and when the process is on updating the dataset it give me error say's"Update requires a valid UpdateCommand when passed DataRow collection with modified rows."The error occur at the line in bold letter in the codes below..
Dim classgroup As String classgroup = "" If Me.ClassComboBox.Text = "Key Project" Then
I have an issue with a data base updating it won't update for me in debgging mode it is stopping here on this bit of code which is highlighted in red. the error which comes up is .(update requires a valid update command when passed datarow collection with modified rows.)
Public Sub UpdateDataSource(ByVal ChangedRows As database.dataset1) Try 'The data source only needs to be updated if there are changes pending. If (Not (ChangedRows) Is Nothing) Then
if i put empty catch blocks for my c# code, is it going to be an equivalent for vb.net's "On Error Resume Next" statement
try { C# code; }
[code]....
i have to convert a vb.net code to c#, and the old code has ~200 "On Error Resume Next" statements although i am using proper try {} catch {} in my new code, but just wanted to know if there is a better alternative.
I keep getting the "Object reference not set to an instance of an object." error and it tells me to check if the pp(f, 0) object is null .... which I know it is not.[code]...
Im trying to write code that will insert 'records' into an xml file, but everytime i click the button to make the changes to the XML file, it throws a null reference exception, ive gone through this code must be 100 times and cannot find what needs to be declared as 'new' as i know nodes can't be 'new' and the doc is 'new'
I get the following exception for the code shown below. The error occurs when i request access token.I downloaded the latest dll(2.3.1) from the twitterizer website.
{"Value cannot be null. Parameter name: String"} Dim OAuthTokens As New OAuthTokens Dim accessToken As New Twitterizer.OAuthTokenResponse accessToken = OAuthUtility.GetAccessToken(ConsumerKey, ConsumerSecretkey, "oauth_token", "oauth_verifier")
MVC 3. VB.NET I have the following controller action in my application to send generated PDF files to the User by download. The function works fine when the controller itself has been invoked. But when I call to the function from outside the controller it returns a " Object reference not set to an instance of an object " error as soon as it hits the response.contenttype line. I have verified that all of the variables are in fact making it to the below action.[code]any ideas why this is only working when called explicitly from inside its containing controller???
I am building a VB.net application using VB Express 2008 which connects to a MySQL database. Right now, I am only selecting records, but will be writing code for update / insert. I have installed the MySQL Net Connector, most recent stable build. I have set a reference to it in project references. It makes a connection and reads just fine, no issues there at all.
My problem is this: When exiting the project (via calling "End") I am receiving a null Exception error. Here is the error[code]....
My code block is below. As it turns out, rdrCurrentRate.GetString(12) is a null value, but the code block throws an error. "Data is Null. This method or property cannot be called on Null values."My intention is to write "if rdrCurrentRate.GetString(12) is NOT NULL, then sCurrentRateType = rdrCurrentRate.GetString(12)"
What am I missing here? If Not String.IsNullOrEmpty(rdrCurrentRate.GetString(12)) Then sCurrentRateType = rdrCurrentRate.GetString(12)
I have the following code below which has an error. When the checkbox is set to true and for example change the "role", and click save the following error is given;
"Index was outside the bonds of the array".
I know the reason of the error but don't know the solution..
The TxtPayCont is a concatenation of title, fname, and lname in an array. Therefore, if all the fields have values, then it works fine. So if it is Mr Jones Tim, this works, but, if it is Mr Jones it does not. It has to have 2 spaces to work. Is there anyway round this...
im getting error when im trying to view a report from my vb2010. value cannot be null. parameter name: dataReader the following is the screenshot for my error and the codes:
I am testing a program, and I am getting a null reference error at this line. oParent.Invoke(oParent.cUpdatingSolidWorks, iSolidWorksItem). I have stepped through the program, and all the items are created. A watch window with the three objects all have data in them. I am wondering what would cause this error if the objects exist. [Code]
I just made a bunch of changes to my program, so I can't just undo what I did. My main form gives me the following error every time I try to load the designer:
Warning1Value cannot be null. Parameter name: objectType
I have rebuild the project with no success. A few other posts have mentioned that there could possibly be a reference to a button or image that no longer exists, but I have no idea which one.
Also, I don't really know what the information below means, but it shows up on the error page under 'call stack', so I figured I would include it
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.GetRuntimeType(Type objectType) at System.ComponentModel.TypeDescriptionProvider.GetRuntimeType(Type reflectionType)
It's saying I cant access this object in my class. Why? I'm pretty sure Ive used this method several times before. Below is some bits of code to figure this out. Object reference not set to an instance of an object."