|
mrkeivan wrote: Could you give me a sample by any chance ?
Of what? Putting a connection string in the application's configuration file? That is a very basic thing and is covered in any basic introduction to the .NET Framework.
|
|
|
|
|
|
Hi All
I want ask you how can i use tree wiew in VB.NET to brows for folders
in specific drive(c:\,d:\,.....)
i want to view all files and i want to open them when them clicked
(i want VB.NET code to implemnt this problem in other words my problem seem like Tree of folders in windows when we select folder all it's content are open beside it and we can select any file by click on it)
|
|
|
|
|
Table 1
-------
col1 col2
------------
1 1
1 2
Table 2
---------
col1 col3
-----------
1 a
1 b
1 c
1 d
Please help me out in building a query which gives the following output:
col1 col2 col3
-----------------
1 1 a
1 2 b
1 NULL c
1 NULL d
Thank u
|
|
|
|
|
SELECT T2.col1, T1.Col2, T2.Col3
FROM T1
RIGHT OUTER JOIN T2 ON T1.Col1 = T2.Col1
|
|
|
|
|
I appreciate ur help. But sorry Colin Angus Mackay it doesnt give the format i wanted,I already tried out all the joins.
|
|
|
|
|
Hi Raj,
select
t2.col1,
t1.col2,
t2.col3
from
tab2 t2
LEFT OUTER JOIN tab1 t1
ON ( t1.col2 = ascii(t2.col3) - 96 )
Results:
col1 col2 col3
----------- ----------- ----
1 1 a
1 2 b
1 NULL c
1 NULL d
Pretty silly way to join data though, I hope it was part of a "puzzle" question and not a serious solution.
Ron
|
|
|
|
|
Hi i want to show total number of months between two dates,
ex:
i shown date in (mm/dd/yyyy)format
Startdate enddate
03/02/2007 06/02/2008
want to show 11 months like how to do this,
plz anyone hlp me...,
-- modified at 6:02 Saturday 26th May, 2007
Magi
|
|
|
|
|
select datediff(Month,'01/01/2000','01/01/2001')
|
|
|
|
|
thank lot,
keep in touch...,
Magi
|
|
|
|
|
In that stored procedure remove '' around @BDate.
i.e., datediff(Month,'dbo.Table.Column',@BDate)
|
|
|
|
|
Hi,
I would like to know the advantages of using ADO.NET in C# application development.
Thank You.
ranga
|
|
|
|
|
rangaSL wrote: I would like to know the advantages of using ADO.NET in C# application development.
It is most advantageous if you want to get data in or out of the database because it is the only way to do that.
|
|
|
|
|
Dear Mr.Colin,
Thank you very much for your reply.
RangaSL
|
|
|
|
|
Dear Ranga,
we cant talk about advantages of ADO.NET because either u use c# or VB or any language that is supported by .net framework the only way to connect to the backend database is by using ADO.NET technology. But we can have a debate on connected scenario and un-connected scenario in ADO.NET or else we can talk about pros and cons of data controls provided in ADO.NET.
|
|
|
|
|
Dear Mr.Raj,
Thank you very much for your reply.
RangaSL
|
|
|
|
|
ADO works on connected environment whereas ADO.NET(Adapter) will be able to work in disconnected environment.
Regards,
Arun Kumar.A
|
|
|
|
|
Dear Mr.Arun,
Thank you very much for your reply.
RangaSL
|
|
|
|
|
Hey gurus,
I have 2 threads, both of them are calling a method which is connecting to database and reading data.
Here is the thread function.
Everything is okay first thread. But, while calling SqlConnection.Open() from 2nd thread, I am getting exception.
Exception is "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."
But, by default pooling is true with maximum 100 connection. Here I created only one connection from 1st thread. Could you please help me....
Here is my thread fucntion...
<br />
private void StartLoading()<br />
<br />
{<br />
<br />
SqlCommand sqlCommand = null;<br />
<br />
SqlDataReader sqlDataReader = null;<br />
<br />
try<br />
<br />
{<br />
<br />
sqlCommand = new SqlCommand();<br />
<br />
sqlCommand.Connection = new SqlConnection("Data Source=XXX;Initial Catalog=XXXXX;Integrated Security=True");<br />
<br />
sqlCommand.CommandText = " SELECT * FROM table";<br />
<br />
sqlCommand.CommandTimeout = 0;<br />
<br />
sqlCommand.Connection.Open();<br />
<br />
sqlDataReader = sqlCommand.ExecuteReader();<br />
<br />
while (sqlDataReader.Read())<br />
<br />
{<br />
<br />
<br />
}<br />
<br />
}<br />
<br />
catch (Exception ex)<br />
<br />
{<br />
<br />
}<br />
<br />
finally<br />
<br />
{<br />
<br />
if (null != sqlDataReader && !sqlDataReader.IsClosed)<br />
<br />
{<br />
<br />
sqlDataReader.Close();<br />
<br />
}<br />
<br />
if (null != sqlCommand && sqlCommand.Connection.State != ConnectionState.Closed)<br />
<br />
{<br />
<br />
sqlCommand.Connection.Close();<br />
<br />
}<br />
<br />
}<br />
<br />
}<br />
<br />
|
|
|
|
|
How do I return records from a query where a specific field does not have a value. I have a query that will return records if the specific field has a value in it, but if the field does not have a value it does not return in record information. Please advise. Thanks in advance.
|
|
|
|
|
dboy221 wrote: How do I return records from a query where a specific field does not have a value.
SELECT * FROM MyTable WHERE SomeColumn IS NOT NULL
|
|
|
|
|
Colin Angus Mackay wrote: SELECT * FROM
I know this is an easy way to show the example but, being that it is an example, some poor schmo might actually use this in production. Might I suggest:
SELECT SomeColumn1, SomeColumn2 FROM MyTable WHERE SomeColumn IS NOT NULL
Never, never use select * in production.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
TopCoderJax wrote: I know this is an easy way to show the example but, being that it is an example, some poor schmo might actually use this in production.
Since no columns where given as an example, there was no list from me to select from.
TopCoderJax wrote: Might I suggest
You can suggest it. My my time is limited and I'm not going to spend time writing out a ficitious list only for the OP to come back and say it doesn't work because *I* supplied invalid column names - And that has happened on a number of occasions. Some people are increadibly thick or just don't want to understand what is going on. (NOTE: This is a general observation and may not apply to the current OP)
TopCoderJax wrote: Never, never use select * in production.
I completely agree.
TopCoderJax wrote: Remember, Google is your friend.
And one which most people shun for some bizzare reason. By the way, have you tried to set up a Custom Google Search[^]? It is great you can set filters on it so you get more relevant hits. I've set mine for code project, microsoft and my blog (because half the time I've done it before but I've forgotten how). I get most everything I want in the first couple of hits.
|
|
|
|
|
A well reasoned response, but I guess we'll have to remain in disagreement I've fixed too many programs/stored procedures where this caused problems; It is the equivilent of nails on a chalk board to me... it just makes my skin crawl.
As to this:
Colin Angus Mackay wrote: have you tried to set up a Custom Google Search[^]?
Really cool tip. I can't tell you how many times I wished they would add this feature. Truely appreciated. I'm going to try it out now.
Thanks.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Hi,
I don't understand ur question. Give some examples.
If I am right , try this
When column is given NULL
Select isnull(<column>,0) from
When column is given NOT NULL
Select case <column> when "" then "0" else <column> end from
Senthil
|
|
|
|