|
a 3d button if there is.. or 3d tab controls... do u have some links that could help me ease on searching from the net?... thank you once again and merry xmas..
nothing is impossible.....
|
|
|
|
|
Google[^]
Just search for ".net windows forms controls" or you can try "Infragistics" or "Dundas", or any other manufacturer that you come acrossed, probably in the ads around CodeProject.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thank you sir... and may you have a very special christmas.....
nothing is impossible.....
|
|
|
|
|
Hi,
I need to link my MS Access database to my vb.net program.
All im looking to do is simply get the user to click a button and by doing so, displaying whats in the MS Access Database.
sounds simple, but I haven't got a clue how to do this, am also struggling to find a tutorial that will teach me how.
I would think its simple as they are both Microsoft products.
Thanks in advance
Jaidev
|
|
|
|
|
There's no such thing as "linking" an Access database, or any other for that matter, you your VB.NET app.
Your VB.NET app can use the database and make queries against it. In order to get the tables, field names, and types in that database, you'll have to query the schema of the database. But, before doing that, I'd suggest learning the basics before getting into something more complicated like this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well you're right about it being easy
if you also happen to have the latest MSDN (free for the express editions)
you'll find great little tutorials there
anyways all you have to do, is follow the wizard in adding a new data source.
there you'll find options as to what kind of database you'll link to.
(choose from SQL Server, or MS Access database)
After that, it'll import the tables and views from the database.
Also it will ask you if you want to make a copy in your working directory or link it permanently
to the database.
(I suggest the first option which makes a new copy after each compile. Otherwise it;s not easy to distribute an application with it's database hardcoded into the application)
Now the easiest way, is to open your form in design view, and go to your data sources, and simply drag and drop the table you want.
have a look at the options then, and you'll quicly get the hang of it.
hope i could help
|
|
|
|
|
Hi,
Thanks for your reply. However were do I find the 'Adding a new data source' wizard?
Thanks in advance.
Jaidev
|
|
|
|
|
Once you've opened a project in VB.NET (i'm using VB.NET Express 2005)
To the right you will see the "Solution Explorer" Panel
Underneath that, you'll see 2 tabs by default. Solution Explorer and Data sources.
Hit data sources, and if you haven't added any, it should have a link to the wizard to add a new one.
Also in the data sources panel you'll find anything you need to handle your data sources.
Hope i could help
|
|
|
|
|
Hi,
Im using microsoft visualstudio 2003.net, I haven't the options you've listed however I have found a way to add the DB to my program, but I cannot click and drag the fields I need to put into the program, how do I go about putting the fields I require.
I haven't come across a wizard, what I did was click on add exisitng item and then browsed for the DB.
J
|
|
|
|
|
That's right, all the new features I was talking about are new to 2005.
Well i'm sorry to say that I don't know of any simple ways to add a database, other than the same ways used in VB/VBA, where you manually declare a database type and connect to it using a connection string.
here's a good example where you also see how to pull data, like an image and put in on a picturebox.
http://support.microsoft.com/kb/321900/en-us?spid=2965&sid=global
It's much easier in 2005 if you are concidering updating. (Also the 2005 Express editions are free)
|
|
|
|
|
Hello,
In an app I am writing, I have a couple of subs that first make some changes to my form controls, then fire one of two data access routines.
The problem is that before the controls completely change, the data access routine fires and the app doesn't respond while it waits on the data access routine to complete. It's not causing any problems, other than it's not aesthetically pretty.
I thought I would put a wait timer between the control changes and the data access routine, maybe 500 milliseconds.
I can't figure out how to make it work, and none of the samples I've found deal with anything as simple as what I want to do.
Private Sub btnShipConfirms_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShipConfirms.Click<br />
GroupBox1.Text = "Shipping Confirmation Data"<br />
btnShipConfirms.Enabled = False<br />
btnOrderConfirms.Enabled = True<br />
btnSendAll.Visible = False<br />
btnSendAllShip.Visible = True<br />
<br />
'this is where I thought it would make sense to put a timer<br />
Timer1.Interval = 5000<br />
Timer1.Start()<br />
MessageBox.Show("here")<br />
<br />
'run data access routines<br />
CreateShipConfirmTempTable()<br />
RefreshShipConfirm()<br />
Thanks for any help.
Mike
|
|
|
|
|
That's not what a Timer is for. A Timer fires off an event every interval milliseconds so you can do something repeatedly.
If you want the controls to change before your data-intensive code starts, just put in a Application.DoEvents() so the controls have a chance to get and process their paint events.
Private Sub btnShipConfirms_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShipConfirms.Click
GroupBox1.Text = "Shipping Confirmation Data"
btnShipConfirms.Enabled = False
btnOrderConfirms.Enabled = True
btnSendAll.Visible = False
btnSendAllShip.Visible = True
Application.DoEvents()
'run data access routines
CreateShipConfirmTempTable()
RefreshShipConfirm()
.
.
.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how i can use the usb port in vb.net?
|
|
|
|
|
You can keep posting the same question over and over, but the answer doesn't change!
You can NOT read/write the USB ports in any way similar to the serial port or parallel port. You MUST write your code to communicate with the device you want in the manner that the device expects. How you do that is ENTIRELY dependant on the DEVICE you want to talk to, NOT the USB port.
What exactly are you trying to do, and don't say "use the USB port". That doesn't make any sense.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
On your code-behind (aspx.vb) page add the following:
Private Function ValidateFormControls() As Boolean
Dim ReturnValue As Boolean = True
If txtFirstName.Text.ToString.Trim = "" AndAlso txtLastName.Text.ToString.Trim = "" Then
ReturnValue = False
End If
ValidateFormControls = ReturnValue
End Function
Code snippet:
Try
If Page.IsValid = False Then Exit Sub
If ValidateFormControls() Then
ReturnValue = objBCBusiness.SaveBusinessName(objAddName)
If ReturnValue = "" Then
ShowBusinessInfo()
End If
ClearTextBoxes()
Else
lblMessage.Text = "All fields cannot be empty."
End If
Note: Add the following to your aspx page:
asp:Label ID="lblMessage" CssClass="red_text" runat="server"
Use the Boolean data type to contain two-state values such as true/false, yes/no, or on/off. The default value of Boolean is False.)
|
|
|
|
|
So is there a question in here? Or are you just posting a public service announcement? And a bad one at that...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Well if the question is - "How do I validate a textbox client side?" then use JavaScript
Steve Jowett
|
|
|
|
|
Hi,
I am facing one huddles in my project.If any one gives solution then it would be great.
let me describe :
We have user requirement that user has to upload .csv file from client browser which contains around 4 columns.Columns includes like firstname,lastname,SSN,DOB field.Now when user upload .csv file (which may containts more then 10K records) we have to validate those fileds format like firstname should be charater no numeric values include,each SSN value should be numeric not character values like that,so now how can i validate each and every value of each column for 10k records???
we are using asp.net with vb.net(as code behind).Can any body suggest me the good solution for that.??If you have any doubt to understand then feel free to ask me.
I will thankfull for that in advance.
regards,
montu3377
|
|
|
|
|
montu3377 wrote: how can i validate each and every value of each column for 10k records???
In a loop? I really don't understand what you are having difficulty with.
I think the problem is insufficiently defined.
For example:
What are you using to parse the file?
What is to happen if an error occurs? Do you stop the process or do you skip the line?
If you continue, how do you want to report it? Should it log if for an admin to look at, or should the user doing the upload be told?
|
|
|
|
|
Hi ,
ok Good questions:
let me give all answers :
let's say .csv file has 10K rows with column firstname,lastname,SSN,DOB.Now you are checking record by record and if you find firstname in bad format like numeric then count that row as bad row and then continue for next record and like that you can get how much are good records and how much are bad records and at end of the finding,you need to show to user that let's say 1000 records are bad and 9000 records are good out of 10,000 records.
This is how you have to report to user,so user can understand that what's problem with rest of records which are bad.
so user can change those records and then upload .csv file again.
I hope your now clear abt output.My main problem is to how to validate each and every rows (records).??If i will count one by one record then performance will be def. a issue.
regards,
Montu3377
|
|
|
|
|
montu3377 wrote: My main problem is to how to validate each and every rows (records).??If i will count one by one record then performance will be def. a issue.
You don't have a choice here. You have to go through this file, one record at a time, parse and validate each field. A RegEx expression would probably speed things up a little bit.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: RegEx expression would probably speed things up a little bit.
And since you are going to use the same 4 or 5 RegEx you may want to consired precompile them.
montu3377 wrote: If i will count one by one record then performance will be def. a issue.
If the Business does not require a sync response, then fire a new thread to do the validation and then email a report when complete.
Just some other options.
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|
|
I have a sub procedure that cleans a text file and write it to the console. Now I need some help appending that cleaned text file to its specified path. Here is the code that I have:
Private Sub CleanFile()
'Read file line by line
Dim file_name As String = "c:\Scanning files\lsprint_MO.txt"
Dim textline As String
If System.IO.File.Exists(file_name) = True Then
Dim objReader As New System.IO.StreamReader(file_name)
Do While objReader.Peek() - 1
textline = objReader.ReadLine() & vbNewLine
If textline.IndexOf("xxxxxxx") = 17 Then
Console.WriteLine(textline)
WriteFile(textline)
End If
Loop
End If
End Sub
Private Sub WriteFile(ByVal fname As String)
Dim oWrite As System.IO.StreamWriter
oWrite = IO.File.AppendText("c:\Scanning files\lsprint_MO.txt")
End Sub
When I run the program I get the following message:
The process cannot access the file 'c:\Scanning files\lsprint_MO.txt' because it is being used by another process.
Any ideas!
jds1207
|
|
|
|
|
Hi,
You are seeing this problem because the WriteFile() function is trying to open a stream to the same file opened in the CleanFile() function.
A quick and easy solution is to create a temporary output file and pass its filename into the WriteFile() function, then at the end of the CleanFile() function delete the original c:\Scanning files\lsprint_MO.txt file and then rename the temporary file...
You can get a temporary file name by:
dim Temp_file as String = my.Computer.FileSystem.GetTempFileName()
Then update WriteFile() function:
Private Sub WriteFile(ByVal OUTPUT_FILE as String, ByVal fname As String)
Dim oWrite As New System.IO.StreamWriter(OUTPUT_FILE)
oWrite = IO.File.AppendText(fname)
End Sub
At the end of CleanFile()
ObjReader.Close()
My.Computer.FileSystem.DeleteFile("c:\Scanning files\lsprint_MO.txt")
My.Computer.FileSystem.RenameFile(Temp_file, "c:\Scanning files\lsprint_MO.txt")
I hope this helps you out....
Regards
Martin
|
|
|
|
|
I got this error message: Illegal characters in path.
This line was highlighted:
Dim oWrite As New System.IO.StreamWriter(Output_File)
Also, am I on the right track?
Private Sub CleanFile()
'Read file line by line
Dim file_name As String = "c:\Scanning files\lsprint_MO.txt"
Dim textline As String
Dim Temp_file As String = My.Computer.FileSystem.GetTempFileName
If System.IO.File.Exists(file_name) = True Then
Dim objReader As New System.IO.StreamReader(file_name)
Do While objReader.Peek() - 1
textline = objReader.ReadLine() & vbNewLine
If textline.IndexOf("xxxxxxx") = 17 Then
'Console.WriteLine(textline)
WriteFile(textline, "c:\Scanning files\lsprint_MO.txt")
End If
Loop
objReader.Close()
My.Computer.FileSystem.DeleteFile("c:\Scanning files\lsprint_MO.txt")
My.Computer.FileSystem.RenameFile(Temp_file, "c:\Scanning files\lsprint_MO.txt")
End If
End Sub
Private Function WriteFile(ByVal Output_File As String, ByVal fname As String) As Boolean
Dim oWrite As New System.IO.StreamWriter(Output_File)
oWrite = IO.File.AppendText(fname)
Thanks!
jds1207
|
|
|
|