Showing posts with label real. Show all posts
Showing posts with label real. Show all posts

Wednesday, March 28, 2012

Problems Inserting DateTimeStamp into database

Here's the error I get trying to run the code posted below..."Prepared statement '(@.datestamp datetime,@.PrevValue real,@.NewValue real,@.IPaddress r' expects parameter @.datestamp, which was not supplied."

I've tried it without the quotes around the DateTime.Now and also adding the # around them. Without the quotes, I do get a different error because it doesn't like the spaces in the DateTime text. Also, the datestamp data in the database is formatted as a datetime (MS SQL Server 2005).

Here's my code:

PrivateSub UpdateRefresh()

UpdateConnection.Open()

UpdateDataAdapter.InsertCommand.CommandText = "INSERT INTO dbo.tbDeploy(datestamp," & _

"PrevValue, NewValue, IPaddress, HighCapability, LowCapability, Share) VALUES" & _

"('" & DateTime.Now & "', '" & lblCurrent.Text & "', '" & lblCurrent.Text & _

"', '" & lblIP.Text & "', '" & lblHigh.Text & "', '" & lblLow.Text & "', '" & lblShare.Text & "')"

UpdateDataAdapter.InsertCommand.ExecuteNonQuery()

UpdateConnection.Close()

EndSub

Use parameterized queries. Your problem will be solved. You can also prevent SQL Injection attacks.

Tuesday, March 20, 2012

Problems bringing up Project REAL

Most of the installation went well. I got to the point of attaching the

source database, but had problems attching the warehouse database:

Database 'REAL_Warehouse_Sample_V6' cannot be started in this edition

of SQL Server because it contains a partition function 'pf_Range_Fact'.

Only Enterprise edition of SQL Server supports partitioning.

I am running standard edition at mey development workstation, the only

one we have running. I do not necessarily need to see partitioning

working. But sounds like I will need to install Enterprise edition at

my development computer to go down this path of discovery? Anyone been

able to do otherwise?

Is there any way to get in and look at the stored procedures at least, or schemas?

Even after going back, it was not clear to me from the prerequisit list that Enterprise edition was required for this.Developer Edition would work as well. Simply a $50 fee for that.|||Yes, it works!

Edition upgrade sucks. I've done it twice, two different ways, and each time it trashes SQL installation. Both times I ended up doing a complete uninstall, and then install. So really the edition upgrade was a wasted diversion of time.

Problems bringing up Project REAL

Most of the installation went well. I got to the point of attaching the source database, but had problems attching the warehouse database:
Database 'REAL_Warehouse_Sample_V6' cannot be started in this edition of SQL Server because it contains a partition function 'pf_Range_Fact'. Only Enterprise edition of SQL Server supports partitioning.
I am running standard edition at mey development workstation, the only one we have running. I do not necessarily need to see partitioning working. But sounds like I will need to install Enterprise edition at my development computer to go down this path of discovery? Anyone been able to do otherwise?
Is there any way to get in and look at the stored procedures at least, or schemas?
Even after going back, it was not clear to me from the prerequisit list that Enterprise edition was required for this.Developer Edition would work as well. Simply a $50 fee for that.|||Yes, it works!

Edition upgrade sucks. I've done it twice, two different ways, and each time it trashes SQL installation. Both times I ended up doing a complete uninstall, and then install. So really the edition upgrade was a wasted diversion of time.