|
Any body know how to use (make) a bit array.
Thanks
|
|
|
|
|
What's the question?
BitArray stores as many boolean values as you want, well, up to 2,147,483,647 of them anyway. First you declare a BitArray object with the number of bits you want to store, say, 100 of them:
Dim myBitArray As New BitArray(100)
Then you use the Item Property to get/set individual values:
For Index = 0 to 99<br />
myBitArray.Item(Index) = True<br />
Next Index
RageInTheMachine9532
|
|
|
|
|
OK, thanks for your answer.
specificaly my question is : How construct the "Binary Blob" from this string "1234567-8".
thanks.
|
|
|
|
|
What are you doing with the blob? Are you doing something with a database?
RageInTheMachine9532
|
|
|
|
|
Pombo wrote:
bit array (BSTR)
A BSTR is different than a bit array. A BSTR is a string data type that stored the length of the string is stored with the data.
-Nick Parker
|
|
|
|
|
I'm new to programming so please don't laugh when you see my question.
What code do I use to open a form in a project when I click a button another form?
It's got to be something really simple and in Access I've used "DoCmd.OpenForm" but apprently it doesn't work in VB.Net. Thanks for any help!
Nathan
|
|
|
|
|
Dim newForm as Form1 = New Form1
newForm.Show()
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Hi All,
I have the following scenario:
in a Bound windows form, I have a master-detail relationship, the first part of the form is the Master(represented by text and combo boxes) and retrives it's Data from a single SQL data table, The Details Section is represented by a DataGrid, and retrives its Data from Multi Tables Sql Query.
I wand to Add/ Insert/ Update and Delete from this Related sections at once, but still facing some problems affecting the Details Section, the modifications are done on the Master only.
The relation between them is build in the run time.
plz, if you have any Idea how to solve such a problem, that will be appreciated.
Thanx All.
I.M.A
|
|
|
|
|
Hi Gang,
I was just wondering if anybody here has done VBA work in professionally released packages.
Here's the deal, part of our program is using Excel/VBA as an add into to our software. We are trying to come up with a way where the code signed projects don't have to ask about macros all of the time.
We are trying to find a way around this. No, not in the sense of by-passing all security, but a way where the user only needs to acknowledge "Trust These Files" from our company.
Anybody have any ideas?
Nick
|
|
|
|
|
Hello
I want to execute a string value in VB.NET
e.g.
dim a as string
a = "msgbox "Emre""
.. a
When I execute this statement it must show the messagebox.
In VB6 I was using Script ActiveX Component.
How can I do that in VB.NET?
Thanks
Best Regards
Emre YAZICI
|
|
|
|
|
Hi,
I used this code on button1_click of a button in Windows form and it displayed me with the messagebox
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strMsg As String
Dim strMsgNew As String = "Pritpal Singh Bumrah"
strMsg = MsgBox(strMsgNew)
strMsg.ToString()
End Sub
I hope this should solve your problems
dickysingh
Nothing New
|
|
|
|
|
Thank you for your answer
My problem is more complicated.
Please consider there is a textbox and a button in my form
When i click to the button the code that i wrote it into textbox , must be executed. But i will not use only msgbox. I will use all of the Vb.NET functions like (int - left - mid ....)
I used to develop it in vb6 using scripting control object
it was able to use ...
script1.execute text1.text
like this..
It executes the code that i have written into textbox.
Thanks
Best Regards
Emre YAZICI
|
|
|
|
|
There is nothing that says you can't do the exact same thing in VB.Net.
All you have to do is go to the references folder in your project, right click it and select Add Reference. Go to the COM tab, scroll down to Microsoft Script Control 1.0, double-click it then click OK. Back in your project, open the code for your Form and put the following line BEFORE the Public Class statement for your Form:
Imports MSScriptControl
Now declare a script control object in an appropriate place in your code, set the control to the language you want to use, and tell it to execute the code you want.
Here is a short example:
Imports MSScriptControl
Public Class Form1
Inherits System.Windows.Forms.Form
' Windows Form Designer generated code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim script As New MSScriptControlClass
script.Language = "VBScript"
script.ExecuteStatement("msgbox ""This is a test...""")
End Sub
End Class
RageInTheMachine9532
|
|
|
|
|
Hi,
Using VB.NET. I'm a beginner so please be gentle..
I am trying to overdraw A ListBox control, among others, so that they have a solid 3 pixel border. Currently I am doing this by creating a customcontrol inheriting from the specific windows control i.e. CustomListBox, inherits ListBox... then handling the WndProc and looking for the WM_Paint message.
I am then calling the MyBase.OnPaint.. this is to handle all of the item drawing, and on TextBox the text drawing stuff etc... then drawing over the 3DBorder with a solid border of the required colour.
However when I do this and the control is resized it flickers quite badly and I want to stop the flickering.
I have tried overriding the NC_PAINT message, which works very nicely, until the list box needs scroll bars.. then I am getting very strange results..
I've also tried setting the styles property to DoubleBuffer.. but that didn't seem to make a difference.
I'm not even sure that I'm going about this in the right way. Does anyone know of a way to do this sort of thing correctly, or a way to stop the flickering.
Any help at all would be appreciated. Even if it's to point me in the direction of a guide or documentation to custom drawing controls
Regards and thanks in advance,
Rig.
|
|
|
|
|
I'm sorry that I cannot be of any help, but I would be very grateful for anything you may have learned in changing the border color of a textbox.
Many thanks
Matt
|
|
|
|
|
How can I load load icon from a file into my vb.net program. i.e. if I use a tree view control it would be nice to get the icon for a specific file type that is registered for that file and load it dynamically into an image list so I can display the correct icon for that file in the tree view. Thanks in advance
Jim
|
|
|
|
|
|
Hi,
I need to call a function in a library that is niether a COM or .NET. (Similar to API but not an API function).
I don't need to pass parameters to this function.
What do I need to do exactly? Do I need to add a reference? (I guess not). How will the run-time know where it is?
Regards,
Ekareem
|
|
|
|
|
Hello everybody!
Can some one please tell me what am i doing wrong here?
Set SearchRS = MSLog.Execute("SELECT OrderNumber, OptOut, DateIn FROM OptOutLog WHERE DateIn between 4/1/2003 AND 4/30/2003")
This does not return any records and i know that there are records with dates in that range
I have tried <= => nothing works
Thank you very much!!!
ilya P.
|
|
|
|
|
i think you need ticks around the dates
Set SearchRS = MSLog.Execute("SELECT OrderNumber, OptOut, DateIn FROM OptOutLog WHERE DateIn between '4/1/2003' AND '4/30/2003'")
and if you are using access you might need the pound signs (#)
Set SearchRS = MSLog.Execute("SELECT OrderNumber, OptOut, DateIn FROM OptOutLog WHERE DateIn between #4/1/2003# AND #4/30/2003#")
also, you might want to add the time, like.... '04/01/2003 00:00:00' AND '04/30/2003 23:59:59'
Steve
|
|
|
|
|
Dear Steve
Thank you very much!!! I tried with ' around before, but i completely
forgot about # signs.
It works like magic now.
Thank you
Ilya P.
|
|
|
|
|
iluha wrote:
Thank you very much!!! I tried with ' around before, but i completely
forgot about # signs.
Access uses the # sign where SQL Server uses a single quote.
-Nick Parker
|
|
|
|
|
I'm building a Service in VB.NET: It's basically watching for a file to appear in a directory; when it does, it processes that file into a database. Depending on the size of the data file, this process can take some time.
What I want to be able to do is prevent the Service Control Manager (SCM) from shutting my service down while it's busy. What is the best way to do this? I tried setting Me.CanStop to false on the fly, but found that it can't be changed while the service is running.
The one idea I've had so far is to create a boolean called isBusy that is set to true while processing and false while idle. Then, in the OnStop event do the following to prevent the stop until the task is done:
Do While isBusy
DoEvents
Loop
But, then what happens when this exceeds the timeout that the SCM has? The SCM reports an error, but does the service eventually shutdown? My main concern is finding a way for my user to shut the service down without shutting down in the middle of a task.
Thanks for any insight.
|
|
|
|
|
I don't think that you can prevent the service form being shutdown.
If all you are trying to do is preserve the integrity of the data that you are importing you can look into other ways to do this, perhaps locally creating the record set then adding it to the DB (this might be faster then adding it to the DB as you read from the file), or try adding the data to the DB inside of a transaction. That way it can be aborted if someone decides to stop in the middle and you won't get partial processed data.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Once the SCM signals the service to shutdown, it will, event if the SCM doesn't "see" it happen. I recommend you don't use a simple boolean, however. Look at the System.Threading namespace, specifically Mutexes or Monitors. These are much safer to use. Basically, the file parsing / processing procedure and the code snippet you wrote above share a mutex or semaphore (a WaitHandle in most cases in .NET) You would obtain an exclusive lock on the mutex / semaphore before doing all your processing. If close is called it'll wait till it can receive an exclusive lock. The reverse is also true, but that processing proc won't be called when the service is shutdown obviously. Basically, however gets an exclusive lock on the mutex first wins and the other(s) wait until they can get an exclusive lock before running their code. This is far more safe.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|