FAQ Database Discussion Community


Operator '-' is not defined for type 'Double' and type 'DBNull'. [vb.net datagridview]

datagridview,vb.net-2010
Here I am getting the following bracketed error (Operator '-' is not defined for type 'Double' and type 'DBNull'.) when executing the NetValueValidation(). But its working in the column of "discper" after executing DiscPerValidation() Private Sub grdPurchase_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grdPurchase.CellEndEdit CellEdited = True CurrentColumn...

How to read/write from file, In Portable Class Library (dll)?

vb.net,file,dll,vb.net-2010
I am build a dll called TdlElement in vb.net. One of the functions in that class need to write a string to file (I have the full file name and the string), well in Windows form application or Console application project I can use - Public Sub WriteToFile(ByVal Filename As...

Deserialize JSON keep getting null referance exception

json,vb.net-2010
Okay, so I want to deserialize the json from https://openrct.net/ajax/chat.php. Problem is that no matter what I try, I end up with a Null Reference Exception when I try to access the stored data. I have been trying for close to an hour, googling and trying different things, and I...

how to create RDLC report using multiple sql columns with same values to count in vb.net

sql-server-2008,rdlc,vb.net-2010
basically i m creating vb.net window application which can show the result in rdlc report... at the back end it is SQL server 2008. Is there any easy way to fill RDLC tablix based on row and column grouping. The situation is as follows. I have a table in SQL...

Object reference not set to an instance of an object on retrieving text from datagridview

datagridview,vb.net-2010
I have a Datagridview that is bound to a database using binding source. I want to highlight the row or text that has the value that I am searching. But for some reason, it gives me this error: Object reference not set to an instance of an object. It points...

Optimal sizes to display X picture boxes in an given space

vb.net,vb.net-2010
I searched before posting but couldn't find anything close to my issue. What I need to figure out is how to come with the optimal width and height of picture boxes (with a 4:3 ratio), given the required number of boxes to be displayed, and the available space. Now, it's...

XmlTextReader error - name cannot begin with the '<' character

xml,vb.net,vb.net-2010
So I am getting an error when trying to read an XML document. I have used code like this before with not issues. I have compared to other code and it is all the same so I have basically no clue what the issue is. Error: Name cannot begin with...

How to change font properties in VB.Net 2010

visual-studio-2010,fonts,vb.net-2010
So I have been using this snippet of code to change font properties Me.lblOutPut.Font = New Font("Times New Roman", 22) However, I have options inside my program to change the font size and font type, and if I have to change the font size, for example, I would have to...

Script Task in SSIS Input0Buffer Error

ssis,vb.net-2010
I need to change existing SSIS package to add new columns. This package has a script task that compares OLD and NEW values. It's giving me bellow errors. at ScriptComponent_2dc377607ff1474a82d85cf977045c1c.vbproj.ScriptMain.Input0_ProcessInputRow(Input0Buffer Row) at ScriptComponent_2dc377607ff1474a82d85cf977045c1c.vbproj.UserComponent.Input0_ProcessInput(Input0Buffer Buffer) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer) Here is the VB code: #Region "Private Constants" Private Const...

How to search and delete multiple text files from a directory using code

vb.net,text-files,vb.net-2010
I have a treeview control on my form and from this form, I save data to text files to a desktop directory in the format: Dan Michael.TXT Dan Michael.GAT Michael Torns.STD I also have a button on the form which the user can click to delete any node, after that...

Visual Basic Threads - Beginner informations

vb.net,multithreading,vb.net-2010
I'm having a simple beginner question about Threads in Visual Basic (2010): if i start a sub as a new thread and in this sub, an other sub is called, is this one also running inside this additional thread? private sub output (... output1 outout2 ... end sub private sub...

Program Flow Structure

.net,vb.net,vb.net-2010
MainSub does 5 tasks. Several tasks are currently written as functions returning whether or not they are successful. I want to continue on to the next task only if the previous completed successfully, else run workerThreadComplete. Is there a way to structure this so that MainSub is more readable, specifically...

Changing the cssclass for a using vb.net

css,asp.net,vb.net-2010
I have this and I want to hide rows dynamically using vb.net codebehind. I am using VS2010. This is my table: <table> <tr id="FromDateRow"> <td><asp:Label ID="FromDateLabel" runat="server">From date:</asp:Label></td> <td> <input type="text" id="txtFromDateF" class="needs-datepicker" /> <asp:TextBox id="txtFromDate" CssClass="hidden" runat="server" /> </td> </tr> <tr id="ToDateRow"> <td><asp:Label ID="ToDateLabel" runat="server">To...

Count Number of Times a Mouse Wheel Scroll Event has Occurred

vb.net,winforms,scroll,vb.net-2010,mousewheel
Right now, a MouseWheel scroll changes the record viewable in my DGV. A negative iDelta moves to the next record, and a positive iDelta moves to the previous record. Each record contains a header/footer and actual data in the dgv. I'm trying to optimize the speed at which I can...

Check Excel File Sheet for missing columns

vb.net,excel,ssis,excel-2010,vb.net-2010
I have an ssis package which takes an excel file and imports it, but if any of the columns in the sheet are missing then the import fails. Im trying to write some code to check the column header in a sheet to make sure it contains a set list...

Cloning datagrid view cell

vb.net,datagridview,vb.net-2010
I have a usercontrol which inherits the winforms datagirdviewcontrol & in here I am trying to clone a cell with its values & store it in a variable. I have cloned the cell with its value by using the below function. Private Function CloneCellWithValue(ByVal cell As DataGridViewCell) As DataGridViewCell Console.WriteLine("Original...

Deleting zero before decimal point in VB.NET

vb.net-2010
This might be a very basic question. I need to remove the zero before decimal point and print it that way. For example if I have 0.8 it should show .8

Connecting two path strings to get the final path?

excel-vba,excel-2010,vb.net-2010
I'm trying to save excel file into a specific path. So basically, when I click the button, I'm creating a folder, and want to save the file inside that folder. The created folder has the current month as name. I'm trying to save into that current month folder. 'Create folder...

remove speical string from lines richtextbox vb.net

vb.net,vb.net-2010
i have a richtextbox with many lines like this `Batman=games\file.exe Batman=games\file\spid.exe SNaruto=games\file\spid.exe spiderman=blue\spk.exe game=gigi.exe i'm trying to make button delete every texts after = to be like this Batman SNaruto spiderman game or even Batman= SNaruto= spiderman= game= thanks...