|
What i wana do is on the client side have two text boxes, one for login name the other for password. after the client is connected to the server the user would enter the login name and password and hit a start button, this would send that data in the textboxes to the server, how would i go about sending that data safe and how would i go about checking that info in a access database and returning info that was saved in the database about the person that was loging in.
thanks
|
|
|
|
|
Since Access is a Desktop Database, not a server database, you'r not sending anything to a "server". You're actually just opening a .MDB file from the clients workstation. There is no server involved. Even though the Access database sits on a server, the client acts just like it was sitting on one of it's own local drives. (BTW: Access is terrible for this!)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok what if i was to switch this database over to a sql server how would I go about this?
|
|
|
|
|
|
Is there any way i can bind untyped dataset to crystal report and show the values of dataset in the report.
|
|
|
|
|
sure you can. so long as the report is getting a dataset that is representative of it's defined datasource then you're ok.
the easiest way to do this is using a typed dataset, but if you don't want to or can't, you can just create your dataset however you're going to do that. (read from database, manually etc.) then when you're to the point where you're going to send the data to the report, just insert a breakpoint and write the dataset out to an xsd file. take this xsd file and use it as the source of your report.
I like to export the dataset including both the xml data and the schema definition. this way when you're defining your report you'll be able to preview what the output will look like.
hope this helps. good luck.
-jim
|
|
|
|
|
What im tring to do im sure is very easy im just not sure of now to do it or what the elements are called.
Basically all i want is a list of buttons (like a menu) up the left hand side of the form, and depending on which button you press, a section of the form changes (to the right) indicating the choice.
For example
If i click Button1 on the left TextBox1, Textbox2 appear on the right
If i click Button2 on the left Textbox3, Textbox4 appear on the right (in the same place as Textbox1 and Textbox2 would appear if i clicked Button1)
I guess im after something like frames in html.
What is the best way to do this in VB.NET
Thanks in advance
|
|
|
|
|
Put a bunch of panels on your form, each panel containing the controls that you want to show when a particular button is pressed.
Set all the panel's visible property to false apart from the one you want to show when the form is first loaded.
In the event handler of each button hide the panels that do not relate to the button that was pressed by setting the visible property to false and show the relevant panel by setting its visible property to true.
You can make it all look very tidy using docking and a splitter control.
Hope this helps
Tom
|
|
|
|
|
Alternatively do the same thing using MDI Forms, which has the added benefit of separating the functionality in a more object orientated manner.
|
|
|
|
|
Hi,
I have the following problem and I am wondering what the general way is to fix this.
I have got a form with an edit and a store button and a customized propertygrid for the user to capture some information.
The thing I want to have is that when the user changes a property value in the propertygrid the store button changes from disabled to enabled. I don't want the eventhandler main event handler on the form. I currently have the propertyvaluechanged handler on the customized propertygrid. The form I am using is also a derived form from the standard one. I guess the simple solution would be to create the handler on the form and have the enabled switch in this handler, but then you would have to re-create this routine each time so I am looking for something a bit more generic. Keep in mind that I am still learning a lot about vb, so a solution that you think would be pretty obvious, could very well be completely unknown to me.....
Thanks in advanced
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
In your inherited control override the protected sub OnPropertyValueChanged:
<br />
Protected Overrides Sub OnPropertyValueChanged(ByVal e As System.Windows.Forms.PropertyValueChangedEventArgs)<br />
<br />
'Put your code here to fire when the property is changed<br />
<br />
'Make sure you call the base method you are overriding<br />
MyBase.OnPropertyValueChanged(e)<br />
<br />
End Sub<br />
In the base class (Windows.Forms.PropertyGrid) this method will simply fire the PropertyValueChanged event, by overriding the sub you can 'slip' your own code in before the event is fired.
More info on this method is available on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclassonpropertyvaluechangedtopic.asp[^]
It is worth investigating these protected methods when you inherit from other classes.
Hope this helps
Tom
|
|
|
|
|
I am using a data adapter to fill a typed dataset via a stored procedure with a parameter to match on the key value. When there is a match on the key, everything is fine. When there is a no match situation, the program crashes with the following error even though I am trapping for errors.
"An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll
Additional information: There is no row at position -1.
"
The crash location is in the ITEM of the DataTable initialization as follows:
Public Default ReadOnly Property Item(ByVal index As Integer) As OptByLRow
Get
Return CType(Me.Rows(index),OptByLRow)
End Get
End Property
The code I am executing is: (ID = incoming key value)
Dim con As SqlClient.SqlConnection = New SqlClient.SqlConnection("blahblahblah")
Dim dsOpt As OptByL = New OptByL()
Dim command As SqlClient.SqlCommand = New SqlClient.SqlCommand()
Dim daOpt As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter()
Dim LID As SqlClient.SqlParameter = New SqlClient.SqlParameter()
command.Connection = con
command.CommandText = "stpOptByL"
command.CommandType = CommandType.StoredProcedure
LID.ParameterName = "@L_id"
LID.DbType = DbType.String
LID.Size = 10
LID.Value = ID
command.Parameters.Add(LID)
daOpt.SelectCommand = command
Try
daOpt.Fill(dsOpt, "OptByL")
Catch ex As Exception When dsOpt.OptByL.Rows.Count = 0
MessageBox.Show("Empty dataset")
Catch exc As Exception
Throw exc
End Try
Return dsOpt
Can anyone help me out?
TIA
Happy Hunting
|
|
|
|
|
FYI, I'm replying to my own request for help.
What's up out there? I thought there were hot shot vb.net "experts" out there that knew the answers to everything? Does no one know the answer to this problem?
Do the experts only reply to the easy questions that anyone can answer?
Happy Hunting
|
|
|
|
|
You (possibly) overload the information in some areas and don't give enough in others, so it is difficult to see what the problem is.
The error message is: An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll Additional information: There is no row at position -1.
You need to give more information. Like at what point this occurred, what command was being executed at the time. The Call Stack will tell you where the error is. The debugger will help you step through the code to see what values are just prior to the error occurring.
You posted a lot of code, however it doesn't seem relevant. But, given that we don't know where the error occurred exactly it is difficult to tell whether it is relevant or not. Perhaps also the SQL statement you are executing is relevant - we don't know.
You probably got no reply because people are busy - they give up their free time to answer questions here and if your question looks like it will waste a lot of time trying to answer then most people won't bother.
NorthernExposure wrote:
I thought there were hot shot vb.net "experts" out there that knew the answers to everything?
The answer to everything is 42
NorthernExposure wrote:
Does no one know the answer to this problem?
Probably people do know the answer but for the reasons I gave above they are unlikely to answer
NorthernExposure wrote:
Do the experts only reply to the easy questions that anyone can answer?
Insulting the "experts" is not likely to generate a positive response.
Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
|
|
|
|
|
First, let me thank you Colin & Dave for replying with what you did. Even that little bit helped get me pointed in the right direction.
I did not, and do not, want to insult the "experts" but it is frustrating to post what I thought was a legitimate problem and get absolutely nothing back. Like you, I am very busy and do not want to waste anyone's time, especially with simple issues that anyone can find the answers to in the plethora of on-line documentation that is available. I am a self-taught VB.Net programmer (actually in the process of self-teaching) and everyone knows that in that situation you have a fool for a teacher.
Your comment re the Stack helped me isolate where the real problem is and I have developed a work-around but not a solution. Here's the scoop:
I am trying to develop an n-tier application with a Windows GUI, business objects to process validation and functionality etc and a data layer to do the actual data retrievals using SQL 2000, data adapters and typed datasets. In this situation where the problem is occuring, I have 1 combobox (ComboboxA)loaded with values from a main table (dsMain) and a 2nd combobox (ComboboxB)loaded with related records from a second table (dsSub). When I select a different item from ComboboxA, I paint an area on the screen with pertinent data from the dsMain record. I then use the key from dsMain to call a business object (boSub) to retrieve the associated child records into dsSub by passing the key value to boSub. boSub issues a call to the data tier (dtSub) to use a data adapter to fill the dsSub with the results of a stored procedure that retrieves all records that match the key value passed to the procedure with a parameter that contains the key value. When there is a match on the key value, dsSub is returned up the ladder to the WIndows GUI, ComboboxB is filled with the results and a separate screen area is painted with data elements from the selected entry in ComboboxB (which, when there is data is initially defaulted to item # 0).
The error was/is occuring when there is no match on the key that is passed (ie no related child records in dsSub) and the program was tring to paint the screen area using data from a non-existent record in dsSub (hence the reference to an index = -1)
The problem is actually happening (I believe) because the program is not recognizing that an empty dataset has been returned even though I have code that is supposed to be trapping for this event. What I have done to check for an empty dataset condition is as follows:
In the business object (boSub) I have created a boolean property called EmptyDataset that is set to false when boSub is instantiated. In boSub, I test for an empty dataset and if that occurs, I set EmptyDataset = True. In the Windows GUI, when dsSub is returned, if EmptyDataset = False, I paint the screen. The problem is that EmptyDataset is not being set to True. This is the actual trapping code that I am using in boSub:
Public Class LenderOptionsBO
Inherits MortgageOptionsDC
Private mbolDSEmpty As Boolean = False
Property EmptyDataset() As Boolean
Get
Return mbolDSEmpty
End Get
Set(ByVal Value As Boolean)
mbolDSEmpty = Value
End Set
End Property
Public Sub New()
EmptyDataset = False
End Sub
Public Shadows Function GetByPKLenOpt( _
ByRef Lmo_id As String) As OptionsByLender
Dim dsOptions As OptionsByLender = New OptionsByLender()
Try
dsOptions = MyBase.GetByPKLenOpt(Lmo_id)
Catch ex As Exception When dsOptions.OptionsByLender.Rows.Count = 0
EmptyDataset = True
Catch exp As Exception
Throw exp
End Try
Return dsOptions
End Function
The code: Mybase.GetByPKLenOpt(Lmo_id) is as follows:
Public Overridable Overloads Function GetByPKLenOpt( _
ByRef ID As String) As OptionsByLender
'
' Get all mortgage options for a lender
'
Dim connection As SqlClient.SqlConnection = New SqlClient.SqlConnection("data source=AGSERVER001;initial catalog=MortgageMulcher;integrated security=SSPI;persist security info=True")
Dim dsOptions As OptionsByLender = New OptionsByLender()
Dim command As SqlClient.SqlCommand = New SqlClient.SqlCommand()
Dim daMrtgOptions As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter()
Dim LenderID As SqlClient.SqlParameter = New SqlClient.SqlParameter()
command.Connection = connection
command.CommandText = "stpOptionsByLender"
command.CommandType = CommandType.StoredProcedure
LenderID.ParameterName = "@Lender_id"
LenderID.DbType = DbType.String
LenderID.Size = 10
LenderID.Value = ID
command.Parameters.Add(LenderID)
daMrtgOptions.SelectCommand = command
daMrtgOptions.Fill(dsOptions, "OptionsByLender")
Return dsOptions
End Function
The code in the Windows GUI where I am checking for an empty dataset is:
Dim i As Integer, bolo As LenderOptionsBO = New LenderOptionsBO(), strid As String
i = cboLenders.SelectedIndex
strid = dsLenders.tblLender(i).Len_id
dsLenOptions = bolo.GetByPKLenOpt(strid)
If bolo.EmptyDataset = True Then
MessageBox.Show("This is an empty dataset")
End If
When there is an actual empty dataset, I am not getting the Messagebox displayed, it is falling through the code and causing the crash.
For the life of me, I cannot see why EmptyDataset = True is not being triggered.
I'm sorry that I have been so verbose. Hopefully one of you can see what stupid mistake I have made.
TIA
Bruce
Happy Hunting
|
|
|
|
|
NorthernExposure wrote:
The crash location is in the ITEM of the DataTable initialization as follows:
What "ITEM"? Like Colin said, we don't know on what line the error occured, so it's really difficult to tell you what happened.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I would like to know if we could set a hot key to open a specific tab page.
I have a form with the tabPage object stuck on it.
On opening the form I have the first tabPage opened by default.
I want to set my F11 key to open the second tab page.
Is this possible.
Tnx
|
|
|
|
|
Quick solution.... add a menu item to the form with the shortcut key of F11 and show the tab page in the menuitem click event handler:
<br />
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click<br />
<br />
Me.TabControl1.SelectedTab = TabPage2<br />
<br />
End Sub<br />
Hope this helps
Tom
|
|
|
|
|
Hi,
I'm trying to delete folders with vb.net. I'm using the following code :
Directory.Delete(dir, True)
Problem : If there is readonly file, the function return an exception. Is there a way to bypass this ? Or should I browse each file and change the attributes before deleting them ?
Thx
|
|
|
|
|
Your best bet is to recurse through the folders:
<br />
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click<br />
<br />
Dim path As String = "C:\Test"<br />
<br />
RemoveReadOnly(path)<br />
<br />
IO.Directory.Delete(path, True)<br />
<br />
End Sub<br />
<br />
<br />
Private Sub RemoveReadOnly(ByVal path As String)<br />
<br />
Try<br />
<br />
Dim currentDir As New IO.DirectoryInfo(path)<br />
currentDir.Attributes = IO.FileAttributes.Normal<br />
<br />
For Each file As IO.FileSystemInfo In currentDir.GetFileSystemInfos()<br />
file.Attributes = IO.FileAttributes.Normal<br />
Next<br />
<br />
For Each directory As IO.DirectoryInfo In currentDir.GetDirectories()<br />
RemoveReadOnly(directory.FullName)<br />
Next<br />
<br />
Catch ex As Exception<br />
<br />
Console.WriteLine(ex.Message)<br />
<br />
End Try<br />
<br />
End Sub<br />
although you could cheat and use the command prompt:
<br />
Dim path As String = "C:\Temp"<br />
Dim command As String = Environment.GetFolderPath(Environment.SpecialFolder.System) & "\cmd.exe "<br />
Process.Start(command, " /C " & "rmdir /S /Q" & path)<br />
... not so professional looking though, but it depends on what your app is for.
Hope this helps
Tom
|
|
|
|
|
Thx for your help.
I'll use the command prompt solution. It's the faster for me.
Sybux
|
|
|
|
|
I am not able to create a record set through a dll. I am using the
db as database
rs as recordset method
and the opening database as db.opendatabase(sdfsdf,sdf)
into rs. It is not working through a dll,
I need it for a project. If anybody is willing to help mail me at
ruturajmd@yahoo.co.in or ruturajmd@gmail.com I shall send you the code for ur review
Please Help Me as soon as possible
|
|
|
|
|
You haven't really given us any details about what you're doing, what your requirements are, what your code looks like, ... All we have is some very vague ideas the you declared "db as database", which is meaningless by the way, "rs as recordset", ... We're going to need much more information in order to tell you anything usefull.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am sending you the basic requirement. What my project wants to do. I have to give it before 6th dec. Please help me it you can. It is a challenging project. I am not able to work on it due to lack of experience is file handeling field.
tInnovative Search and Indexing Techniques.
Locating the right document on computers is becoming increasingly difficult. While searches based on contents of certain types of documents (like Word, EXCEL, Powerpoint files) are available, it is not available for all types of documents such as pictures, music, and video files. This project speeds up document search by building and using indexes.
Various indexing and search techniques were studied and implemented in software, which periodically classify and index the documents on the user’s computer. The keywords identified in the documents are stored in the form of a database to be used for intelligent search. The index database facilitates faster search and allows the user to search for documents based on relevant terms rather than names of files and folders.
The software is developed using client server architecture, which allows search for information on other computers in the network. By enhancing the client and server component, the same can be extended to a web-based search for information
A specialized indexing technique was used for music files. By extracting 20 seconds of audio clips from the music files in WAV format, an index database was built. This database facilitates choosing the right music file based on the audio clips.
To understand content-based search of music, we attempted use of signal processing techniques to analyze music waveform patterns. Application of these techniques to match user-recoded clip with existing waveform was studied. The results are presented as future work needed to make voice based music search possible.
First of all, we're not doing your class work for you. Second, you haven't given any code sample where your having a problem. Just giving us the requirements is not enough.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sir it is not a school project. I had sent this as a concept to a National level Science Convention Sponsered by Intel. The next level to it is the ISEF USA.
Please inform where to send the code.
Is it possible to extract Keyword, relevant word from doc asn text files. I havent been able to write such a program and that is where I am stuck up.
Thanks for replying. I am obliged to receive help from somebody
Thank you.
|
|
|
|
|