|
|
how to send a data line by line?let say i've loaded a hex file such as:
:100000000C28FF309000FF309100900B0528FF3046
:100010009000910B052808008601003066000F3023
:0C002000650006140120061001201128C4
:0203FE000C28C9
:00000001FF
how to make the port send data line by line?can i write like this:
do while (not EOF(HEXfile))<br />
MSComm1.Output=HEXfile<br />
loop
|
|
|
|
|
It won't do this for you.
You have to read the file and output the strings yourself. It's not that hard.
You also have to decide how to handle the file's CarriageReturn/LineFeed characters.
|
|
|
|
|
how to do it?can you give an example?
Just Do It....
|
|
|
|
|
|
Hello,
I am trying to develop a simple COM Server using VB.NET in order to be called from a VB6 existing application exe.
At build time, I always get an error like:
"COM Interop registration failed. Could not load type EventSource.evtContextWrapper from assembly DotNetServerForComClient."
I have this error as well in W2000 and WXP using VS.NET 2003.
For a basic test, I started from a MS sample and adpted it slightly: I have only one class in a class library for which the assembly is signed:
<Assembly: AssemblyKeyFileAttribute("mykeys.snk")>
Here under is the code of my class.
Any help would be very much appreciated.
------------------------------------------------------
Imports System.Runtime.InteropServices
Namespace EventSource
Public Delegate Sub TestEvtDelegate(ByVal inPar As String, ByRef outPar As String)
Public Delegate Sub TestInEvtDelegate(ByVal inPar As String)
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface evtContextWrapper
Sub TestEvt(ByVal inPar As String, ByRef outPar As String)
Sub TestInEvt(ByVal inPar As String)
End Interface
<ComSourceInterfaces("EventSource.evtContextWrapper, DotNetServerForComClient")> _
Public Class Class1
Public Event TestEvt As TestEvtDelegate
Public Event TestInEvt As TestInEvtDelegate
Private WithEvents myTmr As Timers.Timer
Public Function GetTime(ByVal ShowSeconds As Boolean) As String
Dim nm As Reflection.AssemblyName
nm = System.Reflection.Assembly.GetExecutingAssembly().GetName
If (ShowSeconds = True) Then
Return ".NET server, assembly name =" + nm.ToString + " Time is:" + Now().ToLongTimeString
Else
Return ".NET server, assembly name =" + nm.ToString + " Time is:" + Now().ToShortTimeString
End If
myTmr = New Timers.Timer(2000)
myTmr.Enabled = True
End Function
Private Sub myTmr_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles myTmr.Elapsed
Dim strOut As String
RaiseEvent TestEvt("Hello", strOut)
MsgBox("Hello " & strOut)
myTmr.Enabled = False
myTmr = Nothing
End Sub
End Class
End Namespace
--------------------------------------------------------
Michel
|
|
|
|
|
In Code Behind, What is proper select statement syntax to retrieve the @BName field from a table?
Using Visual Studio 2003
SQL Server DB
I created the following parameter:
Dim strName As String
Dim parameterBName As SqlParameter = New SqlParameter("@BName", SqlDbType.VarChar, 50)
parameterBName.Value = strName
myCommand.Parameters.Add(parameterBName)
I tried the following but get error:
Dim strSql As String = "select @BName from Borrower where BName= DOROTHY V FOWLER "
error is:
Line 1: Incorrect syntax near 'V'.
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.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'V'.
Source Error:
Line 59:
Line 60:
Line 61: myCommand.ExecuteNonQuery() 'Execute the query
|
|
|
|
|
Sorry: To further clarify
My database table name is borrower and two of the fields are BName and TaxID, I am trying to select a particular borrower (BName) with a taxid OF 767, lets say in this case THE BORROWER IS Bill Jones
I declared the following variables:
Dim strName As String
Dim parameterBName As SqlParameter = New SqlParameter("@BName", SqlDbType.VarChar, 50)
parameterBName.Value = strName
myCommand.Parameters.Add(parameterBName)
Dim strTaxID As String
Dim ParameterTaxID As SqlParameter = New SqlParameter("@TaxID", SqlDbType.VarChar, 15)
ParameterTaxID.Value = strTaxID
myCommand.Parameters.Add(ParameterTaxID)
I inserted the folowing command:
Dim strSql As String = "select BName from Borrower where TaxID= @333-00-1492 "
I get error:
Must declare the variable '@333'.
|
|
|
|
|
You pass in two parameters but you don't use them in the SQL statement. You then use a parameter (@333 ) that does not exist.
Maybe somthing like this would work:
SELECT BName from Borrower WHERE TaxID = @TaxID You can drop the parameter @BName as it is not being used. To get the BName back into your application you can use ExecuteScalar() .
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I am using multiple dynamically created text box controls placed inside a panel control. I use the panels scrollbar to scroll down and view the data in the textbox's within the panel. It is also feasable that a textbox's size could be larger than the panel is in its height.
Problem is that when a users first clicks on the textbox's data to make an edit for example the panel then auto centers the textbox controls position within the panel. This unwanted control movement moves the text's position and causes undisirable highlighting of a portion of the text as it scrolls past the clicked cursor. Is there anyway to disable this auto control positioning action of the panel control when a control first recieves focus while still preserving the panels scrollbar functionality???
Any help is appreciated,
SBD
|
|
|
|
|
Hi,
I am newbie here.I hope you all can give me some help for the above.
I need to know :
1. Will WebCam store video images captured into a Folder?
2. How to set up a Folder for the WebCam's images captured?
ie : http://domainname/foldername ? is this correct?
If I write a code to retrieve images from the folder, I would only capture the latest image?
Is there any code out there I can use it as reference?
Thanks
|
|
|
|
|
I want source code to Remoting
Server - Client
Ahmed
|
|
|
|
|
You are going to have to be clearer about what you are wanting.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hellow to all ..
i am building a crystal report that have a Boleen fields ..
now i wanna count them , but i wanna only count the true fields ..
it is not working for me how i do it ?
thxx
|
|
|
|
|
Dim id As Integer = dgCustomer.DataKeys(e.Item.ItemIndex)
it gives error
Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index
why??????
|
|
|
|
|
aavesh wrote: why??????
What is the value of e.Item.ItemIndex ?
How big is dgCustomer.DataKeys ?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
how can i pass enter from Vb.net to other programs, so that i need to copy one line after that i want to pass enter after the line not the ascii code for enter just enter cklick without pressing manually on enter
amarni
|
|
|
|
|
You can use
AppActivate("Title Of other Application")<br />
SendKeys.Send("{ENTER}")
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
i want invoice and bill monthly for per customer indiviually using datareports and database msaccess.plz reply.
rais
|
|
|
|
|
Hi Rias,
By executing SQL queries u can get the records for each customer individyally.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
My Repeter control in not displaying the images from databse when i use the following statement.
<asp:image id="Image1" imageurl="<%" container.dataitem%=""> Runat=server>
actuall i want to display all the images from data base along with the price of image.
what should i do?
i'm not getting a point when i give any image path instead of
ImageURL= <% Container.DataItem%> replace ImageURL= "pic.gif"
then it shows no of times this image that i have no record in my database
suggest me.
thanx
|
|
|
|
|
Use the "Ignore HTML" option when you post the message so that your code will be visible.
---
b { font-weight: normal; }
|
|
|
|
|
actually what i want to do i have a table category
in this a user can upload the images for the category.
now i want to display the all the category information with the image on the home page of the site in a 4 * 4 matrix.
what should i do?
thanx
|
|
|
|
|
Read my previous post again. Repeat until it sinks in. There is noone that can help you with your code if they can't see it.
---
b { font-weight: normal; }
|
|
|
|
|
in vb.net
i have an epson printer
and i have added a custom paper
how do i use it in my code?
tried the code below but it says that the kind should be custom, how do i set it as custom i tried but it cant be set.
With oPrintDoc.PrinterSettings
.PrinterName = oDlgPrint.PrinterSettings.PrinterName
.DefaultPageSettings.PaperSize.Kind = _
Printing.PaperKind.Custom
.DefaultPageSettings.PaperSize.PaperName = "TFSC DR Form"
End With
tnx in advance
|
|
|
|