|
New string is an unexperted identified. so how??
Proper Planning is way to success
|
|
|
|
|
Are you using VB6 or VB.NET?
The code sample works as advertised on VB.NET.
The equivelent code in VB6 would be this:
Dim sText As String
Dim iPad As Long
sText = "Text to print Centered"
iPad = ( 40 - Len(sText) ) / 2
sText = String$( iPad, 32 ) & sText
RageInTheMachine9532
|
|
|
|
|
Writing code using VB.net (aspx file)~ script assignment statement: set UserData = request.form("UserData") yields a compile error ~ 'Let' and 'Set' assignment statements no longer supported. Is there a substitute assignment statement that will work instead of 'Set' ?
Many thanks!
Reed Eichner
reichner@satx.rr.com
|
|
|
|
|
Yeah:
Dim UserData As String
UserData = Request.Form.Item("UserData")
RageInTheMachine9532
|
|
|
|
|
Hello,
Is there a way to create an entire Access database (I know what tables and the relationships needed between the tables) using VB code? For instance, if a user clicked on a "Create Plan" icon, the following database would be created in the back end:
Database: Census
Tables:
Client
Plan
Employees
Contacts
If you know of references you could direct me to in order to learn more about this, it would be greatly appreciated.
Thanks so much!
Vi
|
|
|
|
|
There are ways to do this. Are you using VB6 or .NET?
|
|
|
|
|
Hi Mike,
I forgot to mention that I'm using VB.net . I'm a new user and have just gone through my first book Visual Basic.Net Step by Step. I'm trying to create a utility for use at work and have no idea where to begin. Any ideas / help would be greatly appreciated.
Thanks so much!
Vi
|
|
|
|
|
Hi Vi. You know, most beginners start with "Hello World" instead of "Create Access Database from Scratch"
One way to accomplish what you're describing is through the ADOX library. Here's a link to MSDN documentation introducing ADOX:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/admscadoxfundamentals.asp[^]
In a nutshell, the ADOX Catalog object's Create() method will let you create the .mdb file. Then you can use a standard ADO.NET OleDbConnection object to connect to the new database file, and an ADO.NET OleDbCommand object to execute sql statements against the connection. Using OleDbCommand 's ExecuteNonQuery() method will let you issue statements like "Create Table xxx ..." to create your tables. Alternatively, you could use ADOX's Table object to accomplish the same task.
ADOX is a COM library, not a .NET library, meaning that you have to use Interop techniques to use the ADOX objects in your .NET code. This isn't difficult, and there are many articles available on the subject of COM Interop. This article shows an example of using Visual Studio to make the proper references to the COM ADOX library:
http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/32/pid/796/fid/3888[^]
This article (right here on CodeProject) goes more in depth into the concept of Interop. Its fairly long, but toward the bottom are ADOX examples that are directly relevant to the task you're working on -
http://codeproject.com/books/186100558x_16.asp[^]
I hope this gives you something you can work with.
--mike
|
|
|
|
|
Excellent! Thank you so much Mike for taking the time to post this. I will most definitely do some digging.
|
|
|
|
|
Hello, My name is jason.
I am trying to write a program that will track the times and the dates that an employee has worked. I know how to hard code it but, it is the gui that i am having a problem with. Here are my main problems. When the program starts i would like a password screen to appear, where the user or the manager enters her/his password. This part I have accomplished, the password screen. I have placed 9 buttons, when the user clicks on the buttons i record or add to a string, and when the user hits okay, i read the finished string and see if there is an employee. My problem is this, I need to have to different windows, one for a manager, and another for a employee. Meaning, if a manager comes along, types his password, i would like a window appearing where he has the option of looking how has clocked in, how many employees are currently working, total hours ans so forth. When a employee comes along, enters his/her password, i would like them to see when they have started, or if they have not punched in, a punch in button, or a punch out button and so forth..
If anyone could help me out, or give me advice on how to create those two different windows and how to interact or how to dynamilcly pop up those two windows depending on who is entering a password, i would be sooooo happy.
you can email me at jdogan@hotmail.com
none
|
|
|
|
|
Hi! Guys,
I am new to .NET Technologies. I am creating a small application and want to include a facility for Backup.
The problem is, how to create a wizard which will guide the user for creating backup of database, just like Windows. Like, it will ask for path to store backup, other filteration criteria for data to take backup etc.
One approach can be to create a frame for each step and display them as per the user's choice (Back / Next).
Is this approach proper? What are the other possible ways?
Please, send in your suggestions and / or comments regarding this problem.
Thanking you,
Ritesh.
|
|
|
|
|
I was wondering how you would write a file to disk. In 6.0 you used the open command. I was just wanted to know the process of writing to disk.
|
|
|
|
|
What kind of file were you looking at writing? There are a few methods available.
Text files are the easiest and can be done using the FileStream classes:
Dim sr As StreamWriter = File.CreateText(FILE_NAME)
sr.WriteLine("This is my file.")
sr.Close()
Binary files are a little more complicated but are still be based on FileStream classes:
Dim fs As New FileStream(FILE_NAME, FileMode.CreateNew)
' Create the writer for data.
Dim w As New BinaryWriter(fs)
' Write data.
Dim i As Integer
For i = 0 To 10
w.Write(CInt(i))
Next i
w.Close()
fs.Close()
' Create the reader for data.
fs = New FileStream(FILE_NAME, FileMode.Open, FileAccess.Read)
Dim r As New BinaryReader(fs)
' Read data from Test.data.
For i = 0 To 10
Console.WriteLine(r.ReadInt32())
Next i
w.Close()
For more information, lookup 'FileStream Class' in the VS Help Index, or on MSDN here[^].
RageInTheMachine9532
|
|
|
|
|
In visual basic, is there a way to change the tab that is selected before the event for pressing a mouse button is fired? Right now, I want the user to be able to right click on the tab and bring up a context menu for the tab that they click on, but the context menu event fires first, so it is the context menu when the old tab is selected. Anyone know how to change focus first?
thanks
s
|
|
|
|
|
www.DNNCS.com for sale
please email me at kuponutcom@hotmail.com if you're interested
(it stands for...... DotNetNuke CSharp .com)
thanks
|
|
|
|
|
I want to use VB.Net to talk with mobile phone like ( Nokia,Siemen) as following:
-SMS Function (Send , recieve SMS)
-Read Netmonitor from mobile phone
I have got some problem with them.
I need help!
you can send source code or other information to My Email :012272740@mobitel.com.kh
Thanks.
|
|
|
|
|
I have a Datagrid that is bound to a typed dataset that is loaded from a SQL database.
While typing data in a new row on grid the other column cell values all contain the value "(null)".I cannot present something like this to a client. Is there any way of formatting the new row to present empty or default values ?
|
|
|
|
|
Jazeker:
My solution to this problem is to write a function ReplNull which returns a default when a value is Null:
Public Function ReplNull(ByVal varSource As Variant, _<br />
ByVal varReplaceBy As Variant) As Variant<br />
<br />
If IsNull(varSource) Then<br />
ReplNull = varReplaceBy<br />
Else<br />
ReplNull = varSource<br />
End If<br />
<br />
End Function
Or use the CASE WHEN clause in your SQL statement to replace Nulls by your default.
grtz,
Guus
|
|
|
|
|
Hi, Can someone help me with this problemo.
I'm trying to get the context menu to popup only when a specific cursor is showing over the control.
The control switches cursor ( default to hand and back ) when double clicked.
I want the context menu only to popup when the mouse is right clicked AND when the hand cursor is showing.
It works for the first time I switch to hand cursor but once I select a menuItem on contextmenu, the contextmenu pops up with both cursors there after.
Thanks
|
|
|
|
|
hi,KEITHSTER
i hope the following code snippet will help you
first put a contextmenu control and a button control in the form
then at the code part
Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
If e.Button = MouseButtons.Right And Me.Button1.Cursor Is System.Windows.Forms.Cursors.Hand Then
ContextMenu1.Show(Button1, New Point(0, 0))
End If
End Sub
Good luck!
if it still not work,put your code here
I try my best!
|
|
|
|
|
Hi,
I've been trying to access the physical memory (BIOS) from my program, but can't seem to make it work.
Is there anybody who knows how to do it, and could you possibly post some info about this?
Plezzz help me !
--[ There are 10 kinds of people in the world: those who understand binary and those who dont. ]--
|
|
|
|
|
iv created a UserControl with in it iv made a Property with a get and set. If i create it with a return type and input type of an Integer i can modify the property from the property window . . however this is a problem becuase the value that could be inputed could be eather a string or an integer.
Thefore i made it so that the value to be input and returned would be an object. Hoever when i came to look at the property window i was unable to change the value becuase it is now an object i assume. is there any way around this plz, apart from creating 2 propertys. the code below is what iv done.
Thanks for any help that any one can give
Scott
<br />
<br />
Public Property NumberToDisplay() As Object<br />
<br />
Set(ByVal Number As Object)<br />
<br />
If TypeOf Number Is Integer Then<br />
<br />
If (Number < 0) Or (Number > 9) Then<br />
<br />
sErrormessage = "Recived number out side of range of 0 to 9"<br />
RaiseEvent ErrorOccourd(sErrormessage)<br />
<br />
Else<br />
<br />
iNumberToBeDisplayed = Number<br />
Me.Invalidate()<br />
<br />
End If<br />
<br />
ElseIf TypeOf Number Is String Then<br />
<br />
'if Number can not be converted to a string an error will occour<br />
'e.g. inputing a "."<br />
Try<br />
<br />
Dim iNumber As Integer<br />
iNumber = Int32.Parse(Number)<br />
<br />
If (iNumber < 0) Or (iNumber > 9) Then<br />
<br />
sErrormessage = "Recived number out side of range of 0 to 9"<br />
RaiseEvent ErrorOccourd(sErrormessage)<br />
<br />
Else<br />
<br />
iNumberToBeDisplayed = iNumber<br />
Me.Invalidate()<br />
<br />
End If<br />
<br />
Catch ex As Exception<br />
<br />
sErrormessage = "The input value from the string could not be converted to a number"<br />
RaiseEvent ErrorOccourd(sErrormessage)<br />
<br />
End Try<br />
<br />
End If<br />
<br />
<br />
<br />
End Set<br />
<br />
Get<br />
Return iNumberToBeDisplayed<br />
End Get<br />
<br />
End Property<br />
|
|
|
|
|
You could either restrict your Property to String type, since your code handles everything as a number internally, or you could make an overloaded Property, one set for handling a String object and another for handling an Integer object. I'd go with making your property a String if you absolutely had to do string convertion to get an Integer out of it. Personally, if your going to be using the input strictly as an Integer, make the Property an Integer and don't mess with functionality you don't really need.
RageInTheMachine9532
|
|
|
|
|
Dear Friends,
Please write how to convert rtf file into hlp file. Also pls guide me how to call the hlp file in vb project.
looking the response eagerly
Thanks & Regards
Mani
arutperunjothi thaniperungarunai
|
|
|
|
|
On receiving a new mail, I want to capture its handle , so as to read it's subject. this thing should be done on new mail event?
|
|
|
|