|
I still don't understand what you mean. Your description is still too vague.
alek hunter wrote: i'm not add Oledbconnection because it's work but not save the data in access data base
Without a connection to the database nothing will work because the application will not be able to connect to the database in order to issue it with instructions. Especially instructions to insert data.
|
|
|
|
|
hello
I use wizard of VS.net 2005 for access.
I push the save button but it not save in access.
please help me.
thanks for your help
|
|
|
|
|
You're going to have to add a lot more detail to the question than this.
Which wizard did you use? What do you want to do with the Access database? What Save button?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Countered the nutter. I hate it when you post a perfectly valid request for more information to help solve the problem and someone votes you a 2! What is wrong with some people?!
|
|
|
|
|
Is there an easy way to cast from the checkbox.checkstate values of unchecked, checked and indeterminate to an integer? Shouldn't I be able to indicate in my checkbox dialog what the corresponding integer values should be?
thanks in advance
|
|
|
|
|
i = CInt(CheckBox1.CheckState)
or
i = CType(CheckBox1.CheckState, Int16)
you can always ask the value for an enum
|
|
|
|
|
|
I have read some of the articles on this site and others reguarding this issue and all of them involve custom controls or writing a class to accomplish this simple task. Someone has got to know a simple easy way to accomplish this with a few lines of code. I mean VB6 had this property for the textboxes but .NET doesnt and you have to make a custom control or write a class??? This doesnt make any sense. If anyone knows of a simple way to make a textbox accept ONLY numeric and ONLY alpha, please let me know. Thank you in advance.
|
|
|
|
|
pass the 'e' argument of the keypress event of the textbox into either routine:
Public Sub KeyPress_Numeric_Only(ByVal e As System.Windows.Forms.KeyPressEventArgs)
Select Case Asc(e.KeyChar)
Case Keys.Back, Keys.D0 To Keys.D9
'continue
Case Else
e.Handled = True
End Select
End Sub
Public Sub KeyPress_Alpha_Only(ByVal e As System.Windows.Forms.KeyPressEventArgs)
Select Case Asc(UCase(e.KeyChar))
Case Keys.Back, Keys.A To Keys.Z
'continue
Case Else
e.Handled = True
End Select
End Sub
|
|
|
|
|
is this going to work for the seperate keypad as well??? (keypad on the right of keyboard...
|
|
|
|
|
sorry:
Public Sub KeyPress_Numeric_Only(ByVal e As System.Windows.Forms.KeyPressEventArgs)
Select Case Asc(e.KeyChar)
Case Keys.Back, Keys.D0 To Keys.D9,keys.numpad0 to keys.numpad9
'continue
Case Else
e.Handled = True
End Select
End Sub
|
|
|
|
|
I get an error, "Failed to open rowset" when I try and produce an Crystal Report. I am using VB.Net 2003 with CR 8.5. The report database is a text file. I have tried vertifying the database etc but with no luck. Maybe there is something wrong with my Vb code which I have included. Am I doing something stupid with the code. Any help please?
It is a simple setup. Form with a button and Crystal Report Viewer.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strReportPath As String = "C:\Program Files\reports\report1.rpt" 'report1
Try
'Load Crystal Report's rpt file
Dim cr As New CrystalDecisions.CrystalReports.Engine.ReportDocument
cr.Load(strReportPath)
CrystalReportViewer1.ReportSource = strReportPath
'Set the CrystalReportViewer's apperance and set the ReportSource
CrystalReportViewer1.ShowRefreshButton = False
CrystalReportViewer1.ShowCloseButton = False
CrystalReportViewer1.ShowGroupTreeButton = False
CrystalReportViewer1.Zoom(1)
CrystalReportViewer1.ReportSource = cr
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
|
|
|
|
|
I didn't realise that VB 6 was obsolete. What is a good program for a starter? I don't have any specific uses i want to use it for, just to learn more about computers, in general.... J.Paul Ghetty.
|
|
|
|
|
VB.Net is good for starters.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
You can find the free Express Editions of VB.NET, C#, and others here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Oh, he was asking about programs to use, not about languages.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
And your reply to the OP was what? How about a direct reference to a language and development environment!
The OP said that VB6 was obsolete - it is. To me, this means he's looking for the same thing, only more modern. So, I directed him to the free versions of development environments we use today.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
VB.NET is the step child of VB6. C# and VB.NET are both .NET languages, if you like BASIC like syntax, VB.NET is the way to go.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I added a "Discard Unsaved Changes" button to my form.
I want to loop through all the Bindingsources on my form and do a .CancelEdit() on each one in order to discard the changes. (If this is even the way to do it)
Dim BS as new System.Windows.Forms.BindingSource<br />
<br />
For Each BS in ???????<br />
BS.CancelEdit()<br />
Next
I need to get some sort of a BindingSourceCollection object at the ???'s, how do I do this?
(Visual Studio 2005)
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
There is no seperate BindSources collection on a form. It's a control, just like any other. You have to go through the form's Controls collection and find them.
For Each c As Control in Me.Controls
If TypeOf c Is BindingSource Then
Dim bs As BindingSource = DirectCast(c, BindingSource)
' do whatever you want to the bs object...
End If
Next
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi, Thanks for the help.
Dave Kreskowiak wrote: If TypeOf c Is BindingSource Then
The above line generates a syntax error stating:
Expression Type: 'System.windows.forms.control' can never be of the type 'System.windows.forms.bindingsource'
Any ideas?
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
Whoops! My bad. I made a stupid assuption about BindingSource. It won't work because BindingSource doesn't inherit from Control.
No big deal. When you create your BindingSource objects, add them to your own collection. Then you have them all in one place.
Dim bindList As New List(Of BindingSource)
.
.
.
bindList.Add(BindingSource1)
bindList.Add(BindingSource2)
.
.
.
For Each b As BindingSource In bindList
' do what you need to do to your BindingSources
b.whatever...
Next
End Sub
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I added the line I need from an old .NET 1.1 project Inherits System.ComponentModel.Component so that I can drag the SPs onto the component and have everything typed correctly as well as spelled correctly but it isnt working. Is there a new way to do this in 2.0??
Cleako
|
|
|
|
|
Define "isn't working". The Component class is still there are works the same way it did in previous versions of the Framework.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
When I go to add a new item, both in the App_Code and in the project itself, it isnt showing.
Cleako
|
|
|
|