|
I have everything declared, everything is fine, but i still keep getting that same error, there is that blue line underneath the >
|
|
|
|
|
You missed something. Without seeing the EXACT code (copy and paste) we can't tell you what's wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Everyone!
I'm new to VB.Net, but I've got this project that requires a DropDown Selection Box to load one item into a submitButton which passes the item to a textBox as a string. Does anyone know how this is done?
Really need your suggestions.
DuckPlucker
|
|
|
|
|
Are you talking about a web form or a windows form? Also, what do you mean by "load one item into a submitButton"? Buttons don't contain anything, so I don't know what you mean by this.
If all your looking to do is put text into a textbox on a Windows Form, then handling the SelectIndexChanged event of the ComboBox should work:
TextBox1.Text = ComboBox1.SelectedItem.ToString()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I'd like to know if anyone has had any experience with calling DLLS created via VB 6.0 in a C application. The reason I ask is because we are using an Human Machine Interface application which uses a form of C (Called C-Scripting ... an equvalent to VBA) and we would like to use some custom database access dlls that we've already created in C. Do the DLLs have to be rebuilt in a specific way. The equivalent DLL call in VB would be :
Dim x As prjTPMCount.clsTPMCount
Dim vResultDLL As Variant
Set x = New prjTPMCount.clsTPMCount
vResultDLL = x.fctPLC_TPMCount
MsgBox vResultDLL(1, 1), vbInformation, "DLL 1 Output Connection Status"
MsgBox vResultDLL(2, 1), vbInformation, "DLL 2 Output Connection Status"
In C-Script, I tried to declare the .DLL as follows :
#pragma code("RACCTPMCount.dll")
int* fctPLC_TPMCount();
#pragma code()
int* iResult;
iResult = fctPLC_TPMCount();
My error code says it is unable to find the function "fctPLC_TPMCount" in RACCTPMCount.dll
Any help would be greatly appreciated
Cheers
Rusty
|
|
|
|
|
There is no way to "rebuild" a VB DLL in any manner other than the way VB compiles it.
VB DLLs are always created as COM dlls. They don't have any mechanism to export function calls like a C DLL. The only way you can call a VB dll is via the COM interfaces.
You cannot access the VB DLL from C because COM implies classes and interface definitions, and C does not support the concept of a class at all.
Your only option (other than rewrite the VB code in your C language) is to write a C++ proxy component that can call the VB DLL and also exports "C" style function calls that your main application can call.
You can write components in C++ that can interact with a VB DLL using either pure COM programming or using ATL/COM.
Neither is a particularly trivial task.
Unless it involves tons of code I would probably just rewrite the VB code.
If that is not an option, unless you already know ATL/COM or "straight" COM programming in C++ it could take you quite a while to get it all to work.
If you need it quick and cheap, and you don't anticipate any changes once it's done and working, I would suggest farming it out on something like Rentacoder. That's fine for something that you basically just need to get working.
But just be aware that 9 times out of 10 (at least) code that comes out of India, etc. is not going to be commented, maintainable, or for that matter even decipherable for the most part.
I know there are exceptions, and some offshore code is good quality, but it is the exception. Sorry if I stepped on anyone toes, but it's pretty much true.
Robert
|
|
|
|
|
int _stdcall CreateTemp(BYTE* pImageData,int nImageWidth,int nImageHeight,BYTE * pTemplate,int &nSize)
When I run the application , error happened which says the memory is protected.
|
|
|
|
|
I have a VB.Net windows app that retrieves data from 3 different tables. The SQL command uses a 3 table join. The results from the query is filled into a datatable and later populated into a combobox.
The SQL uses the values from a date field inside a text field, for example, 01-15-2005. So, each time I submit the subroutine it executes the SQL command and VB.Net code to retrieve the required data. The date field changes according to the user’s needs.
There’s no consistency when the error pops up.
The error message I’m getting when it executes, da.Fill(dataTable), “There’s no row at position 0”,. The information I’m on the stack track is as follow: Calling SQLDisconnect --- OleDB UnInitialize not called!!!
Connection Object destroyed
If I copy the sql into a sql query tool it does retrieve the required data according to the date field.
Here’s a sample of the subroutine:
cmdQueryINVOICE = _
"SELECT PAYITEM.TRANSACT_NUMBER, " _
& "PAYITEM.ACCOUNT_NUMBER, " _
& "PAYITEM.PAY_DATE, " _
& "LSEINVH.INVOICE_NUMBER " _
& "FROM LSEINVH, PAYITEM, TRANSHDR " _
& "WHERE " _
& " LSEINVH.INVOICE_NUMBER > '" & 75000 _
& "' AND LSEINVH.STATUS <> '" & sStatus _
& "' AND LSEINVH.INVOICE_NUMBER = TRANSHDR.INVOICE_NUMBER " _
& " AND PAYITEM.PAY_DATE > '" & InvoiceDates.StartDate _
& "' AND PAYITEM.PAY_DATE < '" & InvoiceDates.EndDate _
& "' AND PAYITEM.COMPANY = '" & sCompany _
& "' AND PAYITEM.TRANSACT_NUMBER = TRANSHDR.TRANS_NUMBER order by PAYITEM.PAY_DATE desc "
Dim sqlQuery As OleDbCommand = connDf.CreateCommand
Dim dtInvDate As New DataTable()
Dim iInvCnt, x As Integer
Dim sUnitQuery As String
Dim daInv As New OleDbDataAdapter()
Try
daInv = New OleDbDataAdapter(cmdQueryINVOICE, connDf)
daInv.Fill(dtInvDate)
Dim LoopRow As Data.DataRow
Dim test As String = dtInvDate.Rows.Item(0).ToString
For Each LoopRow In dtInvDate.Rows
cboInvoice.Items.Add(LoopRow.Item("INVOICE_NUMBER").ToString + " " + LoopRow.Item("PAY_DATE"))
Next
Catch e As Exception
Dim errMsg As String = e.Message
Finally
connDf.Close()
End Try
Thanks, any help would be grateful.
|
|
|
|
|
I don't know if this will make any difference, but you would be better off using the SQLDataAdaptor, SQLCommand and SQLConnection objects to access SQL. They work better.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
Thanks for your reply. I'll using OleDb is because I'm connecting to a dataflex table and not SQL Server. I did find a solution to the problem. Thanks again.
|
|
|
|
|
I assume connDF is valid somewhere else And you are not even using sqlQuery.
I believe that the table needs to be part of a dataset for the adapter to fill.
<br />
Dim ds As new DataSet<br />
Dim dt As DataTable<br />
dt.TableName="InvDate"<br />
ds.Tables.Add(dt)<br />
<br />
Dim connection as string = "Whatever your connection string"<br />
Dim conn As New OleDbConnection(connection)<br />
Dim adapter As New OleDbDataAdapter()<br />
adapter.SelectCommand = new OleDbCommand(CmdqueryInvoice, conn)<br />
adapter.Fill(ds.tables("InvDate"))<br />
<br />
Dim LoopRow As Data.DataRow<br />
<br />
For Each LoopRow In ds.tables("InvDate")Rows<br />
.....<br />
Next<br />
If that does not work look at how the dataadapter processes joins. It may be the adapter will create the joined tables in the dataset but it will not automatically set the primary keys for the relationship. You may need to create the table schemas in the dataset then fill it. too much trouble? return a datareader and create your own columns and insert the data. Or just loop thru the reader.
|
|
|
|
|
Thanks for your suggestion. I tried your recommendation, but I was getting the same results. I decided to set the date range higher in the sql query and placing the larger results into the dataset. It takes longer to load, but the overall results are much better. Thanks again for your suggestion.
|
|
|
|
|
Hi i am trying to create a new toolbar for IE to change proxies, i keep getting an error that says: "Attribute Specifier is not a complete Statement. Use a line continuation to apply the attribute to the following statement." this is my code:
<guid ("e08554f2-3571-45e5-9a18-13d4dfccdd61")=""> _
' Create new BandObject
<bandobject("ie proxy="" manager,="" cb:="" omar="" ",="" bandobjectstyle.horizontal,="" _
="" bandobjectstyle.explorertoolbar,="" helptext="IE Proxy Manager to change Proxies" )=""> _
how could i fix this?
|
|
|
|
|
You might want to post your question and make sure you check the box down at the bottom of the message window that says "Do not treat <'s as HTML tags".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Why am i not able to create a word application from vb.net web forms.
I am adding a reference to Word Object Library 10.0
I am doing the following.
Dim objWord As New Word.Application
Dim objDoc As Word.Document
objDoc = objWord.Documents.Open("c:\aa\t.doc")
objWord.Visible = True
All it does is hangs at the open .it doesn't even throw an error message.
thanks for your help
|
|
|
|
|
Hi,
I am opening a word document in my vb.net webform.
when the user clicks on a link, it opens a new window with the document.
He edits that document and when closes the browser, it is showing a Save as dialog box. I want to suppress this and save it a default location i specify.
After that I wish to upload it to the server. The users don't want an additional step of upload. So i should be able to save the file somehow on the server behind the scenes
Please give me some clues.
Thanks
|
|
|
|
|
I have a listbox that is bound to a SQLDataAdapter-filled DataTable. I am using unbound textboxes to edit the data when a row is selected for editing, then using a SQLCommand to update the database and refreshing the datatable and listbox.
The problem I am experiencing is that the listbox will duplicate the displaymember of the following item for the item just edited. Clicking the entry correctly populates the textboxes, so the problem appears to be with the listbox itself.
To clarify:
When I first populate the listbox, it may show:
item1
item2
item3
item4
...
I click on item2, which populates a set of text boxes which I then edit and save via a SQLCommand. When the data and listbox are refreshed, the listbox will display:
item1
item3
item3
item4
...
Clicking the first 'item3' still populates the textboxes with the correct 'item2' information.
Does anyone have any idea what might be going on?
Thanks.
|
|
|
|
|
I have a program in which I have to round a decial to the tenth place, what would be the code to do this???
sir - thax - a - lot
|
|
|
|
|
|
Hi. I am creating a Master/Detail DataGrid page and have run into a problem that I just haven't been able to work through. I have successfully created the Master and Detail DataGrids and they display correctly, however, I need to be able to access Checkboxes that I have added to the Detail datagrid.
The layout is as follows. The page is for selecting Training classes that you would like to register for. The DataGrids are both populated using SQL queries and the data is pulled from an Access database. The Master datagrid contains the months for the training schedule. The Detail datagrid contains the schedule of classes. Next to each Class name in teh Detail DataGrid is a checkbox. The Datagrids are enclosed in a Form with a Register button at the bottom.
The user needs to be able to check the boxes of the classes they would like to take and click the Register button.
Now, I had the site working before I created the Master and Detail grids. It was originally one Datagrid. Clicking Register checks to see which checkboxes are checked using a For...Each loop and finding the checkbox controlls in the current DataGrid. It then populates a Datatable with the data from that row (Declared in a Public Property) and passes it to a second page using Server.Transfer to allow the user to enter registration information and confirm selected classes.
The problem came when I created the Detail datagrid. I can no longer iterate through the checkbox controls in the detail datagrid. I am receiving errors when trying to access the internal datagrid. Here is the error
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 112: Dim inDataGridItem As DataGridItem
Line 113: Dim chkClassSelect As System.Web.UI.WebControls.CheckBox
Line 114: Dim dgNestedSchedule As DataGrid = CType(oDataGridItem.FindControl("dgSchedule"), DataGrid)
I don't get the error until the Register button is actually clicked. The Detail Datagrid is being created using ITemplate from a UserControl file so it is being dynamically added to the first cell of the Master grid.
I have tried resolving in a number of different ways, including trying with and without casting. I am using the FindControls method to locate dgSchedule (the detail grid) within the current cell of dgClasses (the master grid displaying the months). But I still receive this error. How do I go about iterating through checkboxes in the nested grid?
Thanks,
Dustin Horne
|
|
|
|
|
I have developed a windows service application that I want to deploy on another machine. The machine does not have Visual Studio installed, it does have the framework redistributable installed. When I try to install the service I am receiving the following error: “Installutil” is not recognized as an internal or external command, operable program or batch file. How do I get the Installutil on the machine?
|
|
|
|
|
|
|
hai,
Everyone who know that sending the command from Server to Client to execute .exe file. thus, Client can perform installation!
Thanks for ur reply!!!
|
|
|
|
|
What server? What client? Are these applications you have written?
Or are you talking about just sending a call to the remote Windows workstation and telling it to run something? BTW: This is a HUGE security violation and unless the account your application is running under has Admin rights to the target machine, forget it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|