|
i have no idea about this but look into appdomain. this may allow you to access what you need.
else
put a listener on your printer program and have you app call it using TCP/UDP to give it instructions.
|
|
|
|
|
You might want to look at the source in this[^] article for an example of implementing shared memory.
There's also this[^] article and this[^] one that get into a bit.
But, in all cases, you'll have to manage this shared area yourself. There is no support in the .NET BCL for shared memory or memory mapped files.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all,
A simple question.Please help me in this.
Const ma111VID As Short = &H846S
What does the "S" stand for in &H846S?
Const RFCMD_REPRGM_CONFIRM As Int16 = &H691A
What does the "A" stand for in &H691A?
|
|
|
|
|
Dont double post!
Posted by The ANZAC
|
|
|
|
|
ashwath1979 wrote: Const ma111VID As Short = &H846S
The literal type character 'S' just means that the number, hexadecimal 846, should be forced to a Short datatype. In this case, it's meaningless because the type that the literal is being assigned to is already a Short. In other words, the 'S' is redundant.
ashwath1979 wrote: Const RFCMD_REPRGM_CONFIRM As Int16 = &H691A
The 'A' is part of the number, not like the 'S' in your previous example. The '&H' part specifies that the number is in hexadecimal format. Hexadecimal is Base16, which has values that go from 0 to F (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). In your example, the number in hex is 691A, or decimal 26906.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Hi there,
I Have a Dataset(vb.net) and that can be contain apostrophes(') in fields. I need to replace all apostrophe with the space character. Is there any way to solve the simple update (without loop) ?
thanks
Murat TURHAN
|
|
|
|
|
From where r u filling the Dataset?
If you are filling it from the DB then the best solution is to replace it in the query.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Yes i m filling from DB but source is constant changing.
therefore tables and fields are uncertain. Dataset is creating dinamically.
Murat TURHAN
|
|
|
|
|
Const ma111VID As Short = &H846S
What does the "S" stand for in &H846S.
Const RFCMD_REPRGM_CONFIRM As Int16 = &H691A
What does the "A" stand for in &H691A.
|
|
|
|
|
Is there something wrong with this line ...
Dim totValue As Integer = CInt(tblDataTable.Compute("SUM(Value)", "Product = 'P199'"))
It doesn't seem to do anything. I put totValue into a messagebox immediately after it, but it simply ignores it and carries on - infact a Try ... Catch in the same area is invoked unnecessarily.
So, I tried removing the 'filter' part of compute (I'm still new to this, and I believe that its optional), so that I had:
Dim totValue As Integer = CInt(tblDataTable.Compute("SUM(Value)"))
But this just underlines the tblDataTable.Compute("SUM(Value)") part in my code, with the 'tooltip', "Argument not specified for parameter 'filter' of 'Public function compute'.
What am I doing wrong?
|
|
|
|
|
penguin5000 wrote: CInt
You should not use this, it's VB6 nastiness. Use Convert.ToInt32 instead, or int.Parse.
The MSDN samples put Sum, not SUM. I wonder if it's case sensitive ?
I'd break it into steps, so you can see which one fails.
Christian Graus - C++ MVP
|
|
|
|
|
Unfortunately, it still isn't working. Is it the way I'm constructing my DataTable? The relevant section is as follows. I'd really appreciate some pointers:
Dim myStreamReader As StreamReader = New StreamReader(txtFilePath.Text)<br />
Dim strLine As String<br />
Dim strProdCode As String<br />
Dim strTransCode As String<br />
Dim intQuantity As Integer<br />
Dim intValue As Integer<br />
Dim intRunningQuantityTotal, intRunningValueTotal As Integer<br />
Dim intNumberOfRows As Integer<br />
Dim tblDataTable As New DataTable<br />
<br />
tblDataTable = New DataTable("TrxContents")<br />
<br />
Dim colProds As DataColumn = New DataColumn("Product")<br />
Dim colTrans As DataColumn = New DataColumn("Trans Code")<br />
Dim colQty As DataColumn = New DataColumn("Quantity")<br />
Dim colValue As DataColumn = New DataColumn("Value")<br />
Dim row As DataRow<br />
<br />
tblDataTable.Columns.Add(colProds)<br />
tblDataTable.Columns.Add(colTrans)<br />
tblDataTable.Columns.Add(colQty)<br />
tblDataTable.Columns.Add(colValue)<br />
<br />
intRunningQuantityTotal = 0<br />
intRunningValueTotal = 0<br />
intNumberOfRows = 0<br />
intOriginalLines = 0<br />
<br />
Try<br />
<br />
Do While myStreamReader.Peek <> -1<br />
strLine = myStreamReader.ReadLine()<br />
intOriginalLines = intOriginalLines + 1<br />
<br />
If strLine.Substring(0, 1) = "K" Then<br />
row = tblDataTable.NewRow()<br />
intNumberOfRows = intNumberOfRows + 1<br />
<br />
'Read the Product Code (start at pos 6. 26 chars long)<br />
strProdCode = strLine.Substring(5, 26)<br />
row.Item("Product") = strProdCode<br />
<br />
'Read the transaction code (start at pos 63. 2 chars long)<br />
strTransCode = strLine.Substring(62, 2)<br />
row.Item("Trans Code") = strTransCode<br />
<br />
'Read the Quantity (start at pos 74. 12 chars long)<br />
intQuantity = strLine.Substring(73, 12)<br />
row.Item("Quantity") = intQuantity<br />
intRunningQuantityTotal = intRunningQuantityTotal + intQuantity<br />
<br />
'Read the Value (start at pos 86. 14 chars long)<br />
intValue = strLine.Substring(85, 14)<br />
row.Item("Value") = intValue<br />
intRunningValueTotal = intRunningValueTotal + intValue<br />
<br />
tblDataTable.Rows.Add(row)<br />
<br />
End If<br />
<br />
Loop<br />
myStreamReader.Close()<br />
<br />
Dim ds As New DataSet<br />
ds = New DataSet<br />
<br />
Dim totValue As Integer = Convert.ToInt32(tblDataTable.Compute("Sum(Value)", "Product = 'P199'"))<br />
MessageBox.Show(totValue)<br />
<br />
ds.Tables.Add(tblDataTable)<br />
Me.grdDataGrid.SetDataBinding(ds, "TrxContents")<br />
<br />
Catch<br />
<br />
... some stuff<br />
<br />
End Try
Thanks in advance.
|
|
|
|
|
Best guess, looking at this code, Value is not a numeric type, which means that Sum won't work on it.
Christian Graus - C++ MVP
|
|
|
|
|
Thanks.
A couple of minor changes:
Dim colValue As DataColumn = New DataColumn("Value", GetType(Integer))<br />
<br />
intValue = Integer.Parse(strLine.Substring(85, 14))
|
|
|
|
|
*grin* Glad to help.
Christian Graus - C++ MVP
|
|
|
|
|
Can you write me why is vb.net batter then oracle? I just want to know...
|
|
|
|
|
u're sentece is out of mind.. we don't understand u. u compares an apple with a car.. oracle is a company and vb.net is a programming language
|
|
|
|
|
I have a problem for datagrid. For now i am able to display wat i wan on the datagrid but the users are able to edit the data on the datagrid and in turn corrupt my DB. What can i do to allow the user to read only but not to write?? Urgent... thanks a lot....
|
|
|
|
|
Subjugate wrote: What can i do to allow the user to read only but not to write??
datagrid1.ReadOnly = true
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Where should i enter tis line. In the datagrid or in the button? Cos in order to activate my datagrid i need to click on a button 1st.
|
|
|
|
|
at the design time set the readonly property to true.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
okok.. Thanks a lot..
|
|
|
|
|
Just enter it anywhere in the code before you actually show the datagrid to the user.
Alternatively you can use this function, that will also lock you dataset for added protection. Just call it before you show your datagrid to the user.
<br />
Private Function ColumnLock(ByVal key As Boolean)<br />
Try<br />
Dim col As DataColumn<br />
YourDataGrid.DataSource = YourDataSet<br />
YourDataGridPA.SetDataBinding(YourDataSet, "YourTableName")<br />
YourDataGrid.ReadOnly = key<br />
For Each col In YourDataSet.Tables(0).Columns<br />
col.ReadOnly = key<br />
Next col<br />
Catch Ex As Exception<br />
msgbox(Ex.message)<br />
End Try<br />
End Function<br />
Johan
|
|
|
|
|
I'm looking for a comprehensive list of properties and methods for the Windows Media player control so I can control it programmatically rather than letting the user muck with the controls. So far all I can find is methods and properties for older versions. I'm gonna keep searching Google, but if anyone knows any lists off hand, let me know.
Thanks.
PS. I'm using VB 6
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|