天道酬勤,学无止境

vb.net

The remote procedure call failed Excel inside IIS

When I try to download an Excel file using asp.net I get this Error The remote procedure call failed. (Exception from HRESULT: 0x800706BE) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The remote procedure call failed. (Exception from HRESULT: 0x800706BE) Source Error: xlworkbook.SaveAs(Path) xlworkbook.Close() xlAPP.Quit() 'error on this line [COMException (0x800706be): The remote

2022-01-19 01:30:08    分类:问答    asp.net   .net   vb.net   excel   iis

close windows form when users click outside

anybody have an idea how to write a code if the user clicks outside windows form, the form will automatically close? I.e., I had two forms, when i show form2 and then i click outside of it, form 2 will closed.

2022-01-19 00:59:46    分类:问答    vb.net   winforms

Pass values from BackgroundWorker DoWork to BackgroundWorker Completed

How do I pass a value from BackgroundWorker DoWork to BackgroundWorker Completed? Since BackgroundWorker Completed is not called by BackgroundWorker DoWork I am not sure how to do this except declare a public variable. Essentially, I want BackgroundWorker Completed to accept through ByVal a variable from BackgroundWorker DoWork.

2022-01-18 23:49:23    分类:问答    vb.net   variables   backgroundworker   pass-by-value   byval

Get a listbox's selected items in javascript

I have two listboxes in asp.net. On the click of a button I want to load a list box with the elements of the selected items in the other box. The problem is that this has to be done on the client side because when the button is clicked I don't allow it to submit. I want to call a javascript function onselectedindexchange but that is server side. any ideas? Should i be more clear? Solution enter code here function Updatelist() { var sel = document.getElementById('<%=ListBox1.ClientID%>') var lst2 = document.getElementById('<%=ListBox2.ClientId %>') var listLength = sel.options.length; var

2022-01-18 23:22:01    分类:问答    asp.net   javascript   vb.net

Multiselect DataGridView without CTRL key with no flicker?

I have a DataGridView control on a form (Form1.vb) and need to allow a user to multiselect rows without using the CTRL key (no keyboard is available - they are using a touch screen). I have enabled the mutliselect property and have the following code in my Form class. My DataGridView is called dgvOEE and I've created a List of selected rows which I add to and remove rows as they are clicked via the "CellClick" event. I then select the row via the PerformSelection routine. Private selectedRows As New List(Of DataGridViewRow) Private Sub dgvOEE_CellClick(sender As Object, e As System.Windows

2022-01-18 21:27:14    分类:问答    .net   vb.net   winforms   datagridview

looping through datagridview

Mine is a windows app. containing forms named BOM nd BOMSelected.. There is datagridview in BOM which contains checkbox column.. When the user selects checkbox, the selected rows should be seen in the datagridview of other form, SelectedBom.. I have coded but don't get it working.. Some error.. Can you please help ?? Your Help is greatly appreciated.. Here is what i have done !! Public Class SelectedBom Private Sub SelectedBom_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'HemDatabase1DataSet4.partno' table

2022-01-18 18:52:48    分类:问答    vb.net   datagridview

Send mail by amazon ses with Arabic sender name

I am using Amazon SES to send mail message to web users and I want to set the sender name in Arabic as below: Dim mailObj As New SendEmailRequest mailObj.Source = "تطبيق كتابى <mymail@mydomain.com>" The mail successfully sent but the sender name is shown in wrong way as below: *7(JB C*'(I mymail@mydomain.com What should I do to view the sender name as configured?

2022-01-18 18:46:38    分类:问答    asp.net   vb.net   email   amazon-web-services

Is it possible to convert vb.net source to C++?

Are there any tools converting vb.net source to C++ eg gnu C++. I know that Mono can transfer the projects to different platforms but i would rather prefer to convert the source. Since all we know that .net uses its own binary libs not available to other complilers is there any tool at least converting vb.net to C++ .net? Thanks in advance

2022-01-18 18:06:48    分类:问答    c++   vb.net

Query MS Access database in VB 2008

I added an Access database as a Data Source in VB 2008. I want to query this database and use the information in various ways throughout the program. For example, there is an Employee table with first/last names of employees. I have a combobox on my form that I want to display all of the employees. So I want to query the database for all the rows in the Employee table, and add them to the combobox as I go. I am familiar with SQL Syntax, so I am not asking how to write the query itself, but rather how to fetch rows in VB code (mimicking php's mysql_fetch_assoc and mysql_connect essentially)

2022-01-18 17:43:05    分类:问答    vb.net   visual-studio-2008   ms-access

Getting ID after insert in SQL Server

I use this stored procedure to make insert and return the id of inserted row ALTER PROCEDURE [dbo].[addObjective] ( @Name nvarchar(250) ,@ObjectiveGroupId int ,@CreatorId int ,@LanguageId int ,@isFinal bit ) as insert into Objective values ( @Name ,@ObjectiveGroupId ,@CreatorId ,GETDATE() ,@LanguageId ,@isFinal ) select scope_identity() as Id; But how to read the returned id using vb.net code using this commands return -1

2022-01-18 15:43:33    分类:问答    sql-server   vb.net   stored-procedures