|
Now that is a good explination
Mongo: Mongo only pawn... in game of life.
|
|
|
|
|
You made a typo in your explanation code, at least I hope it is not in your actual function.
@Col_Name is not defined. @ColumName is.
Mongo: Mongo only pawn... in game of life.
|
|
|
|
|
Hi, thanks for replying. I caught that error and my query now runs but it returns nothing
|
|
|
|
|
Hello,
Is it possible to start a SSIS 2012 DTSX-package via DTEXEC.exe (classic method in command shell) or Integration Services Catalogs (SQL Server 2012) without validating it?
I have several very big packages and the validations take several minutes causing performance problems because I have to run the packages every XX minutes and the validations take too much time.
I read the documentation of DTEXEC.exe and found a parameter that can be used in order to validate a package without executing it, but I need the opposite thing: just execute without validate it!
Thanks for any advices!
Best wishes,
Miroslav
|
|
|
|
|
|
Dim cn As String
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\surendera\Documents\student.accdb"
cn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\surendera\Documents\student.accdb"
con = New OleDbConnection(cn)
cmd.Connection = con
con.Open()
cmd.CommandText = "INSERT into user_acnt(user_name,pas_word) values('" + login.TextBox1.Text + "' ," + login.TextBox2.Text.ToString + ")"
cmd.ExecuteNonQuery()
MsgBox("record successfully saved", vbInformation)
con.Close()
what is the problem in this code...when i run this code it says no value given for some parameter. this code is written within a vb clas named class1 and table name is useracnt
plz suggest me the solution
surendera singh
|
|
|
|
|
There seems to be some confusing code there; you have the connection string twice. You are also using string concatenation in your INSERT statement which leaves you open to SQL injection attacks, and the loss or destruction of your database. You are also displaying the message "record successfully saved" without checking that it actuallky has been, so leading to other errors that you will not know about. I suggest getting hold of some learning materials before going any further.
|
|
|
|
|
In addition to the SQL Injection[^] vulnerability, you're also storing passwords in plain text. You should only ever store a salted hash of the user's password.
You should also wrap the connection and command objects in Using blocks, to ensure that their resources are properly cleaned up.
You should also give your controls proper names, so that their meaning is obvious. Using the default names (TextBox1 , TextBox2 , etc.) will only confuse you when you come back to this code later.
To fix the immediate problem, use a parameterized query:
Using con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\surendera\Documents\student.accdb")
Using cmd As New OleDbCommand("INSERT into user_acnt (user_name, pas_word) values (?, ?)", con)
cmd.Parameters.AddWithValue("p0", login.UserNameTextBox.Text)
cmd.Parameters.AddWithValue("p1", login.PasswordTextBox.Text)
con.Open()
cmd.ExecuteNonQuery()
End Using
End Using
Then, go and read the following articles, and change your database design to store the passwords securely:
Secure Password Authentication Explained Simply[^]
Salted Password Hashing - Doing it Right[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Trying to install MySQL on Windows 7/64 Pro.
It was probably installed and removed a year or so ago. I do use the MySQL Query Browser and the Workbench for remote databases and do not want to remove them.
I do need to be able to test MySQL on my Windows machine so need the Server.
When I download and install any recent MySQL Windows installer the installer does come up but Server is not listed. It did update workbench.
The MySQL bin folder is NOT in program files or program files (x86).
MySQL is not in either Services or Control Panel Uninstall a Program.
How can I get MySQL Server installed and running on my WIn 7????
What am I doing wrong or how do I fix it?
|
|
|
|
|
Did you check your registry?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hello all,
How to change the length of a column in a SQL Server table...
Thank you..
|
|
|
|
|
Balaji Naidu wrote: oralce table
Balaji Naidu wrote: SQL Server table
Which is it - Oracle, or SQL Server?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
|
I'm using this,
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & m_path & "; Extended Properties=dBASE IV"
for accessing dbf files in Account Mate DOS
Is there an Order By, to sort the records by date?
Or do I have to do a sort on the structure that I stored the values in
|
|
|
|
|
|
Interesting.
I used a DataTable in my RDLC report generator class. Forget that I can sort in the report RDLC Tablix.
So I passed a structure to my database class, to load a DataTable in the report class, to pass to the RDLC.
Guess I should take the DataTable straight to the database function to populate it.
I wrote this early last summer, sort of forgot how it worked.
But good call David on the DataTable.
|
|
|
|
|
I'm trying to find a better way of matching an address. So I was thinking, the credit card processors use the street address 1 and zip or postal code to do a AVS match, and perhaps I should just copy that idea.
I wrote this, sort of copied it and made some edits
But I can't get it right. I can't figure out where to place my input to match against.
DECLARE @PostalCode VarChar(12), @CustomerID Int, @StreetAddress1 VarChar(80);
SET @PostalCode = '92648';
SET @CustomerID = 5;
SET @StreetAddress1 = '18751 Park Haven Lane';
SELECT *
FROM CUSTOMER_SHIPPING_ADDRESS
WHERE LEFT(@StreetAddress1, 5) IN (
SELECT LEFT(StreetAddress1, 5)
FROM CUSTOMER_SHIPPING_ADDRESS
GROUP BY LEFT(StreetAddress1, 5 )
HAVING COUNT(*) > 1
)
AND PostalCode = @PostalCode
AND CustomerID = @CustomerID
|
|
|
|
|
Oh I think I get it now, should of had a cup of coffee this morning
DECLARE @PostalCode VarChar(12), @CustomerID Int, @StreetAddress1 VarChar(80);
SET @PostalCode = '92648';
SET @CustomerID = 5;
SET @StreetAddress1 = '18751 Park Haven Lane';
SELECT *
FROM CUSTOMER_SHIPPING_ADDRESS
WHERE PostalCode = @PostalCode
AND CustomerID = @CustomerID
AND LEFT(StreetAddress1, 5) = LEFT(@StreetAddress1, 5)
|
|
|
|
|
You might also want to look into Levenshtein Distance.
Plus, unless you are using an inferior database system, use JOIN s rather than subqueries and IN .
|
|
|
|
|
Oh that looks complicated. hmm, Good idea though.
|
|
|
|
|
I had to use Levenshtein a while back to match addresses from two systems. Some times there's no other way.
|
|
|
|
|
OK.
I'll learn from your experience.
|
|
|
|
|
jkirkerx wrote: AVS match,
There are specific rules associated with that such as removing all punctuation, using abbreviations for standard names, etc. You can probably google for that that.
However those are also intended to match with a credit card and the address. And not just the address. Without some other verification system I doubt just an address match is feasible.
|
|
|
|
|
I should of removed all the chars that are not A-Z a-z 0-9 first.
Well so far so good, much better than before.
I was creating a card record with the billing and shipping address. Worked fine for 10 years.
The users on the back end complained about it. Users with no programming experience complained that if they wanted to ship to a different address, they had to create a new card record and enter all the information again.
So I split everything up into separate records, and recorded the ID's of each record in the order record.
But a problem surfaced with duplicate records, in which I did a horrible job in checking for duplicates.
So checking a card record was easy, but checking a address record became more complicated.
|
|
|
|