|
use this
"select top 1 * from library"
|
|
|
|
|
I'm new to ASP.NET. Can anyone provide answer for my question below?
1. I have a database connection in Page 1; then after some process, it redirect to Page 2. Now my question is, if we don't close the connection (eg: MyDBConn.Close), after redirect to Page 2, will the resourse still grab in Page 1?
|
|
|
|
|
You should always close the connection after working with the database. The best practice model for ADO.NET is aquire-query-release. You should always close a connection to the database as soon as your query is complete.
Also, in ASP.NET the application is stateless. That means that when you request a page it creates a page, populates the page, streams the page to the browser, then deletes all resources used by the page.
NOTE: If a connection to a database is not closed and it goes out of scope so that the garbage collector has to deal with it you will find that the connection stays open until such time as the garbage collector cleans up your mess. That might never happen because your application may break due to lack of connections before the garbage collector gets to it.
|
|
|
|
|
Thank you for the advice. I'm very much appreciated.
|
|
|
|
|
i am a new to vb.net ,i want to create a project on school database using ms access.if u have any such project plz send me the project with code
pramod
|
|
|
|
|
pramod400 wrote: i want to create a project on school database using ms access
If you want to create a project why do you want to get the complete source code from others. Try to do it of your own and in case of some troubles ask here in the relevant forum.
Best Regards,
Apurva Kaushal
|
|
|
|
|
yes u r wright sir
thank you
|
|
|
|
|
hi,I have to display only date from the datetime field of table in DB,
What function i should use in sql query? or Any other way?
Please guide.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
If it's a question of display, your presentation layer should deal with it, not the DB.
Christian Graus - C++ MVP
|
|
|
|
|
Use the following in stored procedure,
convert(varchar,checkindate,101) as checkindate
This will extract only 15/11/2006 only.
For ur reference:
checkindate --> Field in the table.
Hope u will understand it.
Janani
|
|
|
|
|
if you want to extract only date
you can use datepart function as
SELECT DATEPART(month, GETDATE()) AS 'Month Number'
but if you want to see full date u can use
format = "d" or mm/dd/yyyy
|
|
|
|
|
Hi all,
I need to pass the result set from my main report (well, only 1 column, but all values for that column) as a multi-value parameter to a subreport. I know I can have an output parameter from an SP, but that only works for 1 value as far as I know. Is there any way to do this?
Thanks in advance.
OytotheVey
|
|
|
|
|
You could use OpenXML, turn the column into an XML string, pass that through and turn it back to a table in the second proc.
Christian Graus - C++ MVP
|
|
|
|
|
Thanks for the quick response!
Unfortunately I'm not that well-versed in OpenXML, so failing that, is there any way to do this in SQL Server?
OytotheVey
|
|
|
|
|
The books online has heaps of good examples. I don't know another way, no.
Christian Graus - C++ MVP
|
|
|
|
|
Hi,
We have existing tables and a database diagram in SQL2005 - would like to convert the tables and database diagram to Oracle 10 - is there some type of a convertor tool to do this? How can we go about doing this other than trying to create the tables manually??
Many thanks.
|
|
|
|
|
I have Created a FullText Indexed table to store the Doc files.
I want querying the DocAuthor,Size, etc.. from Full Text catalog, not from OS Physical file.
I am using Sql Server 2005.
Regards
Fenil
|
|
|
|
|
Hi to all
Actually we have some data stored in the sqlserver database.know it's time for us to deploy our project ,before doing that we need to generate the script file for the records available in the database and give to the client for the sake of installing the content present init in the server.while we r doing this ,we r able to generate the transact queries for the generation of the tables ...it wasn't invoking the data present in it......how come we do it, plz let me know...!,suggest me the better way's,or u can send the articles related to this type of scenarios
Thanks in Adv
|
|
|
|
|
Export the data to flat files then write an import program to import them. Or use a batched DTS package.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
Or send them a backup of your database instead.
|
|
|
|
|
Hello, i want to copy an image from one row into a other row in the same table...
update TabelName Set Thumbnail = (Select Thumbnail from TabelNAme where Info = 'Test1') where Info = 'TEst2'
But it do not work thx BEnny
|
|
|
|
|
Try putting in a closing bracket
update TabelName Set Thumbnail = (Select Thumbnail from TabelNAme where Info = 'Test1') where Info = 'TEst2')
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
|
hi,
i have to display all the sold product names of a particular month along with the date on which they are sold .
This month and year will be selected by user using dropdown list .
How should i write query to compare selected month and year with the "Date" field of datetime type in DB stored in format mm/dd/yyyy hh:mm:ss.
Please Guide.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Use Year and Month functions in your query
SELECT product.name<br />
from product inner join sales on sales.productid = product.productit<br />
where Year(SalesDate) = @Year <br />
and Month(SalesDate) = @Month
this saves you having to work out how many days in a year.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|