|
Hi, am sorry that i didn't say clearly, i mean that i want to get field data type by using ASP
Socheat
|
|
|
|
|
Socheat.Net wrote: i want to get field data type by using ASP
Try with IIS Metabase.
Regards,
Satips.
|
|
|
|
|
What is IIS Metabase?
Socheat
|
|
|
|
|
|
Hi, the following code is supposed to validate a username using a MySQL database before it and other info of a new user is stored in a database. When I check to see the info that is sent to MySQL, I noticed that it was the default values that I had created for each of the fields in the database that show up. The code below ran just fine but it doesn't do what it was designed to do. Would you please take a look to see what is wrong with the code. At the moment I have yet to use any kind of validations on any of the fields? Thank you in advance for your help.
Private Sub lblRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblRegister.Click
Dim myConnection As OdbcConnection
Dim myCommand As OdbcCommand
Dim strInsert As String
Dim strGoodPassword As String
Dim strSQL As String
strSQL = String.Empty
myConnection = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myMembersdb;User=myUser; Password=myPassword;Option=3;")
myCommand = New OdbcCommand(strInsert, myConnection)
strSQL = String.Format("SELECT UserName FROM myTable WHERE (email='{0}');", txtUserName.Text)
myCommand.CommandText = strSQL
myCommand.CommandType = CommandType.Text
myConnection.Open()
strGoodPassword = CType(myCommand.ExecuteScalar, String)
If Not strGoodPassword Is Nothing Then
lblMessage.Text = "That user name is already taken!"
lblMessage.Text &= " Please choose another user name."
Else
strInsert = "INSERT into myTable (FirstName,LastName,Password,UserName)values(?,?,?,?)"
myCommand.Parameters.Add("@FirstName", txtFirst.Text)
myCommand.Parameters.Add("@LastName", txtLast.Text)
myCommand.Parameters.Add("@Password", txtPassword.Text)
myCommand.Parameters.Add("@UserName", txtUserName.Text)
myCommand.ExecuteNonQuery()
myConnection.Close()
End If
End Sub
de", txtUserName.Text)
myCommand.ExecuteNonQuery()
myConnection.Close()
End If
End Sub
-- modified at 18:05 Sunday 17th June, 2007
|
|
|
|
|
Not sure of your core problem, but you should read up on SQL injection attacks, and safe ways to check username/password combinations.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
But the data never shows up in the database at all. The insert query that you put in strInsert is never used. You never put the insert query in the command object, you just execute the select query twice.
The insert query is not even possible to execute as it stands. You have to change value to values .
Christians point about sql injections is valid too. You are using parameters for the insert query, why are you not using it on the select query?
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi there Guffa, I have shortened the code by taking out some of the unessential part of the code to make it easier to spot the problems. I have also changed the typo that you've pointed out, however I don't really know what you said when you said I did not use parameters in the select statement. Can you please show me? I am a novice at asp.net and vb.net and I would like to learn this thing as fast as I can, thank you again for your help.
|
|
|
|
|
Hi,
My page contains several radiobutton controls and i want it to write checked radio button's id on the page.but how can we find checked radio button control by looping not using if or switch conditions or something. i gotta handle it with looping.
Thanks and Regards...
|
|
|
|
|
I hope some body help me as possible as
|
|
|
|
|
atarikg wrote: i gotta handle it with looping.
You can't do that. There is no collection of selected radio buttons that you can loop through. There isn't even a collection of radio buttons.
There is a collection of form elements, you have to loop through that to find the radio buttons, then check each one of them to see if it is selected.
---
single minded; short sighted; long gone;
|
|
|
|
|
atarikg wrote: i gotta handle it with looping.
No, you don't.
There's actually a findcontrol method, or you can use recursion to find the controls that have the right names, or even to find all radio buttons, if you want to find all the radio buttons that may be checked, or if there can only be one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
So there are any sample codes ? I wish you had given some sample codes or articles' adresses..
|
|
|
|
|
|
I want to do something once per day in asp.net such as sending birthday email everyday automatically. I want once per day to send email,read email address from database and if birthday field == DateTime.Now automatically send email.
please help me. how do I do?
|
|
|
|
|
You have to setup a system which must work non-stop such as a server. You can use web service and when in the time - when the mail must send to the users in order to warn them about what you want to say your website's users - your system send a mail i hope it is understandable...or i messed it up
|
|
|
|
|
Hi. thanks a lot for your attention.unfortunately I cant use web services.do you known a sample in the internet?
thanks in advance
|
|
|
|
|
Actullay i don't..sorry..but you can googled..
you are welcome beforehand..
|
|
|
|
|
Hi,
One thing you can do is:
1. Create Console Application. make this application such that whenever it runs, it gets all the data for birthdays and send emails.
2. You can set this application to run on any particular time in day/night using windows schedular (Control panel --> Scheduled Tasks) (Make sure this schedular is runnig in the server).
hope that helps.
|
|
|
|
|
Hi.How can we display two tables in a single data grid.
|
|
|
|
|
You can use templates in GridView.Just create your template and put your controls - which you desire to use - in the template and bind your controls to the fields you fetch from your database.
http://www.asp.net/learn/dataaccess/tutorial12cs.aspx?tabid=63[^]
Check this link written above out
Hope it helps...
atarikg......................
-- modified at 16:51 Sunday 17th June, 2007
|
|
|
|
|
Could you be little specific, I thing you can user NESTED DatGrid to dispay more than 1 table
Nobody is perfect i'm Nobody
|
|
|
|
|
Hi,
I have the following regular expression in my asp:RegularExpressionValidator control:
<asp:RegularExpressionValidator
ID="RegularExpressionValidator_Password"
ControlToValidate="Password"
Display="Dynamic"
ErrorMessage="Invalid password:<br />Password must have 8 to 50 characters,
cannot contain spaces, must begin with a mixed case alpha character, at
least one uppercase character, at least one lowercase character, at least
one numeric character, and one special character of the following: # $ _"
ValidationExpression="^(?=[a-zA-Z])(?=.*[0-9])(?=.*[#\$_])(?=.*[A-Z])(?=.*[a-z])(?!.*[^a-zA-Z0-9#\$_])(?!.*\s).{8,50}$"
ValidationGroup="CESignIn"
runat="server">
This regular expression is only triggered in IE7, in Mozilla it is not. My password is Password3#. This correct according to the regular expression. But why is it triggering when I type the password in IE7?
Please can someone help?
Regards
ma se
|
|
|
|
|
My second post here - I'm really loving this site...anyway, here is my question:
1. Is there a free public domain web service where I can send an IP Address and have the geographic location info returned?
2. Or a public domain file that I can download that provides similar info that I can parse?
Not sure if this the right spot to post this message, but thanks in advance! (I did a quick search on this site, but couldn't find this question)
|
|
|
|
|
I googled and found lots of paid services, and this: http://www.geobytes.com/IpLocator.htm[^]
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|