Questions tagged [vb.net]

36267 questions
0

votes
0

answer
6

Views

Secondary thread causes “Application has stopped working” crashes even when invoking

I have an application which has a form with a DataGridView bound to a BindingSource, which is bound to a DataTable: bsList.DataSource = dsData bsList.DataMember = 'List' dgvList.DataSource = bsList The underlying data which populates dsData.Tables('List') can change whilst the user is working so to...
WSC
1

votes
2

answer
199

Views

How to use dll for VB.net to C#

I have dll and sample code using VB.net. However I need to use functions in E5KDAQ.vb using the E5KDAQ.dll file on C#. May I know how to achieve that? Can anyone give any good examples on how to use it? E5KDAQ.vb Imports System.Runtime.InteropServices Imports System.Threading Imports System.text Imp...
Thomas Koh
0

votes
0

answer
9

Views

How to check for strings in a panel?

I'm making a string checker which should check for a string on a website. I'm using a panel instead of a web browser because I merged chromium with CefSharp into it. Now I can't figure out how to check for a string in the panel. I tried creating a different type of variable, but the variable comes f...
Wolf
1

votes
2

answer
35

Views

VB.NET: “AddHandler” by specifying Handler function as a variable

I'm writing an add-in for Autodesk Inventor (a 3D CAD program). The add-in adds a bunch of internal commands to Inventor, and creates a toolbar button for each command. I need to connect the Execute event for each of those commands to a handler function in my add-in. I've created a 'MyCommand' class...
DRoam
1

votes
2

answer
56

Views

How to check if a query returns a null value and add it to a label text?

I am creating a new app in Windows Forms (vb.net) that checks if there are any records added on a daily basis to a SQL database, based on some criteria. The issue is that I can't figure it out, how to display some message in a label box if the query returns a null value. Public Sub LoadUser2() Dim d...
Adi Petrescu
1

votes
1

answer
45

Views

Is there a way to count dynamic table rows in citrix/image env in UIPATH

I am doing automation to download all document by customer. i am having trouble with counting total rows in table because it is image based env. you can see the following image i have tried to find selectors, but there is no selector Can any body tell me how can i do it Thanks
Harshit Kudeshiya
1

votes
1

answer
36

Views

Difference Between <%#..%> and <%#:..%>? (Colon Symbol)

I stumbled upon Microsoft ASP.NET's WingTipToy project where the line of code uses
henry
1

votes
1

answer
34

Views

Check if MySQL UPDATE query was successful or not

I have a login system, that will have an option to change a user password if forgotten once they answer their security question correctly. Everything is working fine, except I'm unsure how to determine if it was successful or not. If TextBox1.Text = TextBox2.Text Then Dim conn As MySqlConnection con...
Anthony
1

votes
2

answer
2.4k

Views

getting certain bytes from byte array in vb.net

I have a byte array containing bytes from a file(see my last question) now I want to get the second lot of 4 bytes from the array and convert them to an integer something like bytearray.get(4[start],4[length])
Jonathan.
1

votes
1

answer
1.9k

Views

How to determine which DataRow is bound to a DataGridViewRow

When I use a DataTable as a DataGridView's DataSource, I often have to find which row(s) a user has selected and read specific values from the DataTable (not the DataGridView) I wanted to know if there is any reliable way of determining which DataRow a DataGridViewRow is bound to especially when the...
Alex Essilfie
0

votes
0

answer
5

Views

.NET Web Application Set Link to Open Only One New Tab in IE11

I'm working on a web application (IIS) targeting .NET 4.0 using Visual Studio 2015. I have a link to a third party that I want to open in a new tab. However, if the user has already clicked it and opened the new tab and then they click the link again I don't want it to open yet another tab - it sho...
MF Luder
1

votes
2

answer
5.5k

Views

How to query the current URL to see if it contains a certain string

What I want to do is take the full contents of the address bar and see if everything after the site path (i.e. everything after the question mark), contains a certain string, and if it does then return a path using the site URL and that string. An example and some code to make things understandable:...
dudledok
1

votes
3

answer
1.4k

Views

Batch updating of an Access database (DDL) . Possible?

I have taken over support of a VB .Net application that makes use of an Access database. Now I discover that the developer who wrote this application did not create any unique indexes on the primary key columns for the tables in the database. So none of the primary key fields are actually flagged as...
BruceHill
1

votes
5

answer
3.5k

Views

How does the 'Split()' function work in VB.NET?

I'm working in Visual Basic .NET, and I'm trying to get split to work. Here is my code: Public Sub CheckUpdate(ByVal FileURL As String) Dim instance As WebClient = New WebClient Dim ApplyTo As String = instance.DownloadString(FileURL) asd = ApplyTo.Split(',') End Sub I use it like this: Private Sub...
Devfly
0

votes
0

answer
13

Views

Vb.net how to put datagridview to report tablix. Datagrid view is not connected to database

I fill a datagridview and iwant to print it on report viewer. Itried some q&a here but only the number of rows apear not the datas.
kim miki
0

votes
0

answer
10

Views

How do you convert JSON in VB.net for consumption in PHP

I was handed a php file that submits a JSON String to an API. The application I am working with to do the same, however, runs on VB.net. I have used a Dictionary object to reconstruct the JSON object but I am getting some subtle differences in final output. Here is my code: Dim data As New Dictionar...
Hannington Mambo
0

votes
0

answer
4

Views

How to put in progress bar in the vb.net coding when execute a stored procedure

Im new to the .net programming, I just want to try and help my company improve the system. I want to show the progress bar when i click the compute button, the compute button is execute the stored procedure. I have try to search online, youtube for create the progress bar, but unfortunately that is...
Jackson
0

votes
1

answer
890

Views

Can I create a constant expression for use in attribute parameter?

As anyone answering this already knows, parameters of attributes require constant expressions. Optional parameters (for anything, not just attributes) also require constant expressions for their default values. The (albeit minor) inconvenience I'm having is with RegularExpressionAttribute's pattern...
Lopsided
3

votes
1

answer
162

Views

Clear RichTextBox text through UI Automation?

In C# or VB.NET, I would like to clear the entire text of a read-only RichTextBox control that reside in a external WPF application. The control supports text pattern, but not value pattern. The goal is to prevent this control from appending thousands of new text lines, because at the end I noticed...
ElektroStudios
0

votes
0

answer
4

Views

Using MS Word as spell checker in VB.net application on same monitor

I am using the code from http://www.vb-helper.com/howto_net_spellcheck.html that uses Microsoft Word's spell checker and modified slightly to fit my application. But sometimes the spell check window opens on the secondary monitor and need it to open on the same monitor as the VB.net application. Dur...
bikidunker
1

votes
2

answer
5.3k

Views

LINQ Select Syntaxt VB.NET

I have a list of Tuples I am trying to run a Select and Where query on to return a list of Objects from the Tuple.Item5 parameter. In my where clause I am looking to match Tuple.Item4 to a local variable. I'm not sure what the VB.NET syntax is for the Select portion, I only know the c# syntax. Esse...
Belgin Fish
-3

votes
0

answer
25

Views

Show updates from Vending Machine on other forms [on hold]

I made vending machine. In this code, I want to click form1 button4 then show sales volume of vending machine in form2.label1: 'this sales volume have to accumulate when i buy in vending machine' and 'this sales volume show in form2 label1' in this code i want to do when i click form1 button4 then...
hahahahah
0

votes
0

answer
7

Views

VB.NET how to persist the Z-order of my window forms app's windows?

I have an app that opens at run-time 8 windows, each a graph. How do I persist the Z-order of the 8 windows relative to each other? My fellow employees use this app and stretch and move around the windows, and when they put one window over another, I want to restore this Z-order at boot. Persisting...
Doug Null
1

votes
2

answer
38

Views

How to support contextual implicit conversions of custom object in Visual Basic .NET?

I want to use named error codes within my app. This should ensure, that every developer does not confuse numeric-only error codes with other codes, and also reduces the time a developer needs to realize what the error code should represent. Compare this example: Function New() As Integer Return 0 En...
burnersk
1

votes
1

answer
58

Views

Is there a way to set the period of time that the mouse must be over a control in order to trigger its MouseHover event?

I need a way to set the MouseHoverTime Property, or some other way of making it so that the mouse needs to be over a control for a given amount of time before an event kicks in. I have a set of controls that need to execute code when the mouse passes onto them, which can be done with either MouseEnt...
Gondola
1

votes
2

answer
30

Views

How to do this?: DataTable.Select(“[Enabled].ToUpper ='TRUE'”)

Is there a way to include an embedded .NET function in a DataTable Filter? I assume not. Please see my embedded comments in the code pertaining to the ToUpper function that I want to include. Imports System Imports System.Data Imports System.Linq Module Program Sub Main(args As String()) Dim MyTable...
ChadD
0

votes
0

answer
23

Views

Is there any way I can sort a this table using 'ORDER BY'?

I have an 'accounts' table that contains a group account (isgroup) with subaccount (groupcode): | code | title | groupcode | isgroup | groupindex | |------|----------------|-----------|---------|------------| | 100 | Current Assets | | 1 | 0 | | 101 | Cash...
Melvin
1

votes
2

answer
75

Views

Changing from AnyCPU to x86 causes System.BadImageFormatException error

I have created a WinForms UserControl. When I leave the platform at AnyCPU, I can debug it without any problem: When I press Play, the preview comes up. Then I try to change the project to x86. Therefore I click 'AnyCPU', then 'Configuration Manager'. At 'Active project platform', I select 'New...'....
tmighty
0

votes
0

answer
8

Views

Cascading combo boxes in VB.Net with Datatables using Designer

I found this tutorial and am trying to make it fit my needs using the designer. I could design the data tables using the designer in VB.net but when I try to execute, I am getting an error on this line Dim dv As DataView = combo2.DataSource https://www.tek-tips.com/viewthread.cfm?qid=1534892 Private...
Shan
1

votes
2

answer
40

Views

Is there a better way to write this. Trying something till 3 times or success

Basically I want to try something 3 times. If it fails I try again. If it works I move on. If it keeps failing after 3 times I am out For i = 1 To 3 Do Dim json = CookieAwareWebClient.downloadString1('https://api.bitforex.com/api/v1/market/symbols') If json = '' Then Exit Do End If jtok1 = JObject.P...
user4951
-2

votes
1

answer
15

Views

Unable to cast object error when attempting to return key/value pairs by querying a datacontext

I am attempting to get data from a datacontext. Normally, I've had no problems doing it, but I'm having trouble trying to return a list of key/value pairs. Basically I'm attempting to grab all unique names from a table as the key column and the number of times they appear in the table as the value...
Carlos Mendieta
0

votes
0

answer
101

Views

Excel Data Validations corrupt worksheets (when copying?)

Edit: I further looked into this issue and have now a minimal file in which I can reproduce the error/bug. All Add-Ins are deactivated and I use only 4 lines of VBA-Code: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Tabelle15.Range(Target, Target.Offset(1, 0)).En...
be_kehrer
1

votes
3

answer
10.8k

Views

.NET DateTime.ToString() - Default Format Setting

Is the default format of ToString dependent on anything server related? Here's the issue: I'm testing and have tested an application on my local machine and ToString(), by default, is returning in a format of 'MM/dd/yyyy hh:mm:ss tt', however on our server it appears to be returning as 'dd/MM/yyyy...
Wes P
0

votes
0

answer
3

Views

Crystal Report how to eliminate duplicate data in details section?

I created a report that has fields from 2 tables but CR automatically duplicates the data in the details section which is a pain in the a**. Is there any way to eliminate this kind of behavior? Here is my code so far: Dim reportsfolder As String = Application.StartupPath + '\PrintArea\' Dim comand A...
Jeffrey Oliveras
1

votes
1

answer
28

Views

Copying Clipboard text including tables to microsoft word (.docx) file

Dim objApp As Word.Application Dim objDoc As Word.Document objApp = New Word.Application() objDoc = objApp.Documents.Open('C:\Users\bn\Desktop\DCIM\lol.docx') objDoc.Activate() objApp.Selection.TypeText(My.Computer.Clipboard.GetText) objDoc.SaveAs('C:\Users\bn\Desktop\DCIM\lol2.docx') objDoc.Close()...
Kishan Gupta
1

votes
0

answer
254

Views

VB.net WPF and Win 10 Toast Notifications

I'm trying to show toast notifications in Win 10 from vb.net WPF app. 1. I added 10.0 to .vbproj file in the section. 2. I Added references to Windows.Data and Windows.UI 3. My code: Class MainWindow Private Sub BtnClick() Dim ToastN As ToastNotification = New ToastNotification('Test', 'This is tes...
RadiM
1

votes
0

answer
48

Views

To find what kind of usb is connected to the port using vb.net

I have a com port and i want to send messages to it. I want to be certain that is port is of the type RS 485. How can i do that. I have searched online and the only way i see is through the win32 dll. is there any other way and if there isnt could you please point me to the win32 method. I have the...
TheNoob
1

votes
1

answer
63

Views

Binded DataGridView only updating the currently selected row

I'm working on getting my DataGridView controls to auto update the values of my objects in my object model. I have object arrays that I'm binding to my DataGridView through the following code Dim bs As BindingSource = New BindingSource() bs.DataSource = aryJoints DataGridJoints.DataSource = bs I am...
RobotGuy
1

votes
1

answer
235

Views

how to download a file with its cookie and URL?

I have a big problem downloading .xlsx files from a site automatically. I have tried the following code and cookie is ready: Dim request As HttpWebRequest = CType(WebRequest.Create(('http://www.trademap.org/Country_SelProduct_TS.aspx?nvpm=1|||||0101|||4|1|1|1|2|1|2|1|1')), HttpWebRequest) request.Co...
Alireza Allahdadian
1

votes
1

answer
61

Views

Desktop admin panel for web app

I'm building a eCommerce web application for shops using Laravel/Foundation/PostgreSQL, and it will provide them (shop owners) with web based admin panel. My question is, can I make the super admin panel (the tool that I use to control everything) using desktop technology such as VB.net (or anything...
Ahmad Issa

View additional questions