|
Thanx alot till i Try it
ThaScorpion
|
|
|
|
|
Have U order it by date?
Janani
|
|
|
|
|
Is there a way to run a query where i delete all rows containing a row ID in a text file? ie. I have a table "Items" with a column "ItemID". Id like to delete every ItemID row contained in c:\test.txt
Any help would be appreciated.
|
|
|
|
|
Hello everybody,
How to build a regular expression to check that all the given words are present in a sentence in any order but all words should be present.
for example: Given words:- aaa bbb ccc
sentence:-1) rock aaa bed bbb sky ccc
2) rock bbb bed aaa sky ccc
3) rock aaa bed bbb
Matchs:- 1 and 2 should get matched in the sentence
3 is not a match
Mitesh... best of luck..
|
|
|
|
|
select sentence
from ( select sentence
from ( select sentence
from book
where sentence like '% aaa %'
)
where sentence like '% bbb %'
)
where sentence like '% ccc %'
; It's not a regular expression, but this is the SQL forum after all.
Chris Meech
I am Canadian. [heard in a local bar]
I agree with you that my argument is useless. [Red Stateler]
Hey, I am part of a special bread, we are called smart people [Captain See Sharp]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
hello All,
i am a beginner in vb.net. am creating a small project in vb.net. using sqlserver 2000 as back end. i am creating the application and code . finally am creating package. all those things are working correcly in my system only. but the packages(setup1) installed n other system but not working well. whenever the database using page is open or button click action. it was so some error that 'System.Data.Sqlclient.Sqlconnection' threw an exception' and the button press action it was shown 'Object references not set to an instance of object,. Please help me it is very urgent.... so plz plz plz help me solve this problem.
attached code below
<br />
Imports System.Data.SqlClient<br />
Imports ADODB<br />
<br />
Public Class screen1<br />
Dim con As SqlConnection<br />
Dim cmd As SqlCommand<br />
Dim dr As SqlDataReader<br />
Dim str As String<br />
Dim c As New ADODB.Connection<br />
Dim rs As New ADODB.Recordset<br />
<br />
Private Sub screen1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
con = New SqlConnection("server=software;uid=sa;pwd=sa;database=payroll")<br />
c.Open("DSN=Emp", "sa", "sa")<br />
rs.Open("empl", c, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)<br />
End Sub<br />
<br />
rrrriiizz
|
|
|
|
|
You are instantiating object con and then trying to open object c without instantiating it...
|
|
|
|
|
By using this code i am getting the whole database row i want only the first row of database table name is library..hoe can i do that??
Sub BindGrid()
Dim myConnection As New SqlConnection("server=(local);database=pubs;uid=sa;pwd=;")
Dim MyCommand1 As SqlDataAdapter = New SqlDataAdapter( _
"select * from Library ", myConnection)
Dim DS As DataSet = New DataSet
MyCommand1.Fill(DS, "Library")
MyDataGrid.DataSource = DS.Tables("Library").DefaultView
MyDataGrid.DataBind()
End Sub
GANESH
|
|
|
|
|
To do this you need to have a uniquely representing column(i.e a primary key column),and by makeing use of it u can select which ever the row u want..!(let us say primary column as id)
change your select statement to..."select * from Library where id=1"
|
|
|
|
|
u can use dataview to bind ur datagrid and can use dataview's Rowfilter property to filter the data according to condition specified by u.
rahul
|
|
|
|
|
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
|
|
|
|