Need help on Visual Studio 2010 databinding

I am doing a project which require me to use visual studio and chart control with databinding together with SQL database.

By the way, I am not very good in programming, therefore I used the databinding wizard provided by VS.

I having some problem where I can't query using current timestamp.

e.g. on SQL management studio.

I can use "select * from tabe where datetime = current_timestamp"

but on the VS2010 databinding wizard, it don't allow me to use "current_timestamp" as it prompt me invalid .net framework datetime data type.

can any pro ppl here who can help me on this?
Encapsulate the query in a SQL Server stored procedure. That should do it.
Thank you for your advice. but It seems like not possible to do so as my query statement using variables.
i.e. example

SELECT [quote_date], [close_price] FROM [hist_quotes] WHERE (([symbol] = @symbol) AND ([quote_date] >= @quote_date))

I got no problem with @symbol as it retrieve on textbox control. But for @quote_date. I would like to retrieve from the current datetime value.
Stored procedures can have input parameters. This should not be a showstopper.
Dear webJose,

sorry I am not good in programming and SQL. what do you mean by stored procedures can have input parameters? how to make input parameters?
Use SomeDB
Go

Create Procedure myschema.MySP
@param1 int
, @param2 nvarchar[100]
, @param3 bit = 1 --This one with optional value
As
Begin
Select *
From mychema.myTable
Where somecolumn >= @param1
Or someOtherColumn = @param2
Or (@param3 = 0);

return @@Error;
End
Go

If you want to know more about stored procedures, search the web. Obviously this is a C++ forum and not the right place for this. Good luck.
Last edited on
Topic archived. No new replies allowed.