|
I have a nested loop in which I am looking at username and password if they click more than 3x's I lock them out... However, my loop won't work... Here is the code
While DR.Read()
'If i <= 3 0 Then
If User = DR("DTLoginID").ToString() And Pwd = DR("DTPassword").ToString() Then
Response.Redirect("Broadcast.aspx")
ElseIf User = DR("DTLoginID").ToString() And Pwd <> DR("DTPassword").ToString() Then
MsgBox.alert("The Username and/or Password does not exist; Please Try Again")
Me.txtUser.Enabled = True
' i = i + 1
ElseIf User <> DR("DTLoginID").ToString() And Pwd <> DR("DTPassword").ToString() Then
MsgBox.alert("The Username and/or Password does not exist; Please Try Again")
Me.txtUser.Enabled = True
' i = i + 1
End If
'ElseIf i > 3 Then
'MsgBox.alert("No User Exist")
'Response.Redirect("Broadcast.aspx")
' End If
End While
It will go straight to the (marked out items) elseif i > 3 and do the redirect.... any suggestions..
|
|
|
|
|
You might want to try an Exit Sub after each of the if traps. You might be getting stuck in your while loop after one of your conditions has been met.
While DR.Read()
'If i <= 3 0 Then
If User = DR("DTLoginID").ToString() And Pwd = DR("DTPassword").ToString() Then
Response.Redirect("Broadcast.aspx")
Exit Sub ''''<addded code="">>>>
ElseIf User = DR("DTLoginID").ToString() And Pwd <> DR("DTPassword").ToString() Then
MsgBox.alert("The Username and/or Password does not exist; Please Try Again")
Me.txtUser.Enabled = True
' i = i + 1
Exit Sub ''''<addded code="">>>>
ElseIf User <> DR("DTLoginID").ToString() And Pwd <> DR("DTPassword").ToString() Then
MsgBox.alert("The Username and/or Password does not exist; Please Try Again")
Me.txtUser.Enabled = True
' i = i + 1
Exit Sub ''''<addded code="">>>>
End If
'ElseIf i > 3 Then
'MsgBox.alert("No User Exist")
'Response.Redirect("Broadcast.aspx")
Exit Sub ''''<addded code="">>>>
' End If
End While
Best of luck
Forever Developing
|
|
|
|
|
While DR.Read()
If i <= 3Then
If User = DR("DTLoginID").ToString() And Pwd = DR("DTPassword").ToString() Then
Response.Redirect("Broadcast.aspx")
ElseIf User = DR("DTLoginID").ToString() And Pwd <> DR("DTPassword").ToString() Then
MsgBox.alert("The Username and/or Password does not exist; Please Try Again")
Me.txtUser.Enabled = True
' i = i + 1
ElseIf User <> DR("DTLoginID").ToString() Then
MsgBox.alert("The Username and/or Password does not exist; Please Try Again")
Me.txtUser.Enabled = True
' i = i + 1
End If
'ElseIf i > 3 Then
'MsgBox.alert("No User Exist")
'Get to the screen where you want user to know that user is been locked
exit while
' End If
End While
|
|
|
|
|
I am interested in dividing my components into run-time and design-time components. I want to do this so that code I only need for design time is not included in the run-time component, which is shipped to an end-user. The design time component would only be needed by the programmer when making use of the design-time capabilities of my component, such as using it in the Windows form designer.
It does not appear this is possible in .NET. I can still certainly divide my component into two different assemblies, one for run-time code and one for design-time code. But it seems there are two reasons that I can not make the sort of clean division in which both assemblies need to be available at design time while the run-time assembly only needs to be available at run-time.
The first reason is that the classes I use for my design time code, derived from System.ComponentModel, do not necessarily only pertain to design time functionality. According to the documentation on type converters, as an example, they might apply both to design time and run-time. There seems no way to specify that a type converter, which I would put in my design-time assembly should only pertain to design-time code.
Secondly to use the classes in my design time assembly at design time, I must provide attributes for the types and properties to which the design-time classes pertain in my run-time assembly and, since the attributes refer to classes in another assembly, the run-time assembly must reference that other design-time assembly. This effectively ties my run-time assembly to these classes which I only want to use at design time.
Has this issue been addressed or discussed anywhere ? It does seem to me wasteful that .NET classes which I create only for design-time functionality needs to be distributed to the end-user by a programmer who uses my component, even though the end-user will never need the functionality. Furthermore I see no way to tell .NET that the casses which I create for design-time functionality should only be used at design time and not run-time.
Because of these issues, I have a feeling that there must be a way to create a design time assembly for my component which does not have to be unnecessarily shipped to end-users as part of run-time execution. Does anybody know how to do this ?
Edward Diener
|
|
|
|
|
Hi,
Is there a way to increase the height of a list view item?
Also, if the font is increased to, say, 10 from 8.25 (default), the text gets truncated in display and the full letter(s) is/are not visible in the available item height.
anyone knows a way out?
any help/suggestion appreciated.
Thanks.
|
|
|
|
|
Thank you Valadatanciu
I do use Abort() function for the thread before exit the program. It has not being helping.
Simply by calling Application::Exit() will still keep the instance of the process. I tried it before and I tried today after seeing your post. The results were same.
I do not have same problem in C#. Calling Application.Exit() will clear the process in C#. I wonder C++ side did not do good job on garbge collection work as MS declared.
|
|
|
|
|
Application::Run(new FormFoo()); starts a new application based on FormFoo, what means that starts the wndProc based on that window. so basicly if you close the window with this->Close(); the FormFoo wndProc will not process anymore windows messages and your code will continue runing from winmain and stop the thread exectution with return 0;
how do you exit your program? with Application::Exit(); or with this->Close(); (i recomand the first option)?
by the way my name is Vlad Stanciu not valalalal
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Thank you very much for trying to help again, Vlad.
Sorry I just copied your ID Valadatanciu yesterday in my reply since I did not know your name.
I always use Application::Exit() to terminate my programs in .net. Yesterday, I found that the reason not working this time, was I used a thread and suspend it during the middle of execution, then computer did not like it so even when I called Application::Exit(), the process was still alive. After I took the suspend() function out, it closed properly. What a mess!
Thank you again.
|
|
|
|
|
Hi ,
As anyone encountered an error message stating that the form that was specified as the MDI Parent is not an MDIContainer. I can understand that this would arise when the form has not had the IsMDiContainer property to true however i have set this property and the application was running fine until yesterday evening any ideas. i am about to unistall framework and VS2003 and reload.
Can anyone help?
Cheers
dazzler
|
|
|
|
|
I use managed C++ and use Application::Exit() to terminate my program. The GUI was gone after call the function. However, the process is still in my Windows Task Manager. How can I kill the process when I exit the program?
My code starts at:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;
Application::Run(new MainForm());
return 0;
}
and end with:
MainForm::Close();
Application::ExitThread();
Application::Exit();
Anything missing here? Your help will be greatly appreciated.
|
|
|
|
|
your thread is still runnig probabliy because you didn't do a good cleaning (you leted some objects that couldn't be closed opened)
I sugest you close the program by simply by calling Application::Exit(); this closes the window opened for message loop end exits the application.
if you are not satisfied by this mthod you colud always abort a thread (cause an imediatly close and resource freeing process) like this (for the curent thread) System::Threading::Thread::CurrentThread->Abort();
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Good day all…
I am interested in adding the fading color (similar to the Windows Media Player version 10) scheme to my Main Menu. Does anyone have an object type or maybe guide to a location where I can complete this solution?
Thanks in advance for your assistance.
Have a great coding day.
Regards,
Tony D. Abel
|
|
|
|
|
I have the following code, but I cannot seem to get the changes in the dataset to be commited to the database. All I get is a 0 rowcount:
Private editQry As String = "select idc,nomiko,Eponymo,Onoma,Tel from Persons where idc=1"
Private adoCEDataAdapter As SqlCeDataAdapter
Private CustEditDataSet As DataSet
Private cb As SqlCeCommandBuilder
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub frmCustEdit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
adoCEDataAdapter = New SqlCeDataAdapter(editQry, frmConnect.adocon)
cb = New SqlCeCommandBuilder(adoCEDataAdapter)
CustEditDataSet = New DataSet
adoCEDataAdapter.Fill(CustEditDataSet)
txtSurname.DataBindings.Add(New Binding("Text", CustEditDataSet.Tables(0), "Eponymo"))
txtName.DataBindings.Add(New Binding("Text", CustEditDataSet.Tables(0), "Onoma"))
txtTel.DataBindings.Add(New Binding("Text", CustEditDataSet.Tables(0), "Tel"))
cbLegal.DataBindings.Add(New Binding("SelectedIndex", CustEditDataSet.Tables(0), "nomiko"))
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(adoCEDataAdapter.Update(CustEditDataSet).ToString())
Me.Close()
End Sub
I have tried to create the Update query with:
adoCEDataAdapter.UpdateCommand=cb.GetUpdateCommand
and it returns a query, but again nothing happens on the adoCEDataAdapter.Update(CustEditDataSet)
Help....
|
|
|
|
|
Hi all,
I've created a new windows form application (C++) project,
and I can't see the form's events - not under the Properties window and not in the bar that is above my code editor. Do I have to add anything to support this?
thanks.
/=/=/=/= Sagmam =\=\=\=\
|
|
|
|
|
This is my first time delploying a windows application. I was able to deploy it to a computer that has .net installed but how do I deploy to a computer without .net installed. I think I need to add dotnetfx.exe to my installer but don't know how. Are their any walkthroughs out their that are simple to follow for a first timer? Please help.
Thanks in advance,
Beginner in VB.Net
|
|
|
|
|
You can do many things to get .NET installed on the target machine. InstallShield has .NET built in and will create an installer or if you have Visual Shtudio 2003 then you can use the PluginInstaller[^] from Microsoft and then just create a setup project and .NET will be included for you.
Steve Maier, MCSD MCAD
|
|
|
|
|
I am using Visual Studio 2002 Framework 1.0. How do I use the installshield? Again this is my first deployment so any examples would be great.
Thanks
Beginner in VB.Net
|
|
|
|
|
Installshield is a separate app that you would have to purchase. You would be in better shape to just use the deployment projects that are built into VS 2002.
Steve Maier, MCSD MCAD
|
|
|
|
|
How do I do that? I need to figure out how to check if the computer has framework 1.0 and if it doesn't install it.
It tells me that Dotnetfx.exe can be redistributed with your setup. How do you do this?
Thanks
Beginner in VB.Net
|
|
|
|
|
Hi !
I've got an binary executable from Internet, which firstly checks if .Net is installed on the computer. If not , it executes dotnetfx.exe to install .NET. After installed .NET, it automatically launchs the deployment of your windows application.
This binary executable works with a configuration file. Here is the content of this file named settings.ini
[Bootstrap]
Msi=<DeployingApplication.msi>
FxInstallerPath=<D:\dotnetfx.exe>
where
<DeployingApplication.msi> is the path to your windows application installer .
<D:\dotNetFramework> , is the path to dotnetfx.exe
Then save the modifications.
But I don't know how to send you the binary file that automatically install .NET
Could you help me ?
|
|
|
|
|
Hi
Am I creating a new file called settings.ini or am I modifying an existing one?
What is the file called that automatically installs .Net? If you know where it is just send me an email and attach it to the email (timothy at myactv dot com). Or if you can remember the link from where you got it, you can send me that too.
Thanks
Beginner in VB.Net
|
|
|
|
|
Here is a link to the .NET Downloads[^]. This link has all versions of .NET and the service packs too.
Steve Maier, MCSD MCAD
|
|
|
|
|
I have downloaded the framework 1.0 sp2 and installed it. How do I use it in my deployment project?
Is there something I am missing here?
Beginner in VB.Net
|
|
|
|
|
Microsoft made is simple to add the framework to your setup programs for the VS 2003. I am not sure if the same thing works on 2002 or not. I am thinking that it would not. InstallShield was one of the simplest ways to put it in, but that is a separate purchase. The NSIS[^] installer has samples of getting the framework from Microsoft's website during the install. For 1.0 there was not a really good way that I know of to make sure that it was installed besides a 3rd party installer. That is one reason that I upgraded to VS 2003.
Steve Maier, MCSD MCAD
|
|
|
|
|