Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Monday, March 19, 2012

need sample code in vb.net

Hi,

I neew a small sample code in VB.NET to create a custom data flow component for SSIS.
All the examples I was able to find it are in C#.

Answer very apreciated.

Go to http://msdn2.microsoft.com/en-US/library/ms136112.aspx

Thanks,
Loonysan
http://mystutter.blogspot.com/

|||There are a number of websites that provide conversion utilities to convert C# to VB. Using those will increase the amount of sample code available to you.|||

SQL Server ships with several simple samples of SSIS components. Please install the SQL samples. The December update is available from MSDN at http://www.microsoft.com/downloads/details.aspx?FamilyId=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en.

-Doug

need sample code in c# to connect to sql database

hi,
i learn by practice and i would like an asp code using c# that connects to sql database can retrives information from a table.
can you please copy paste me some code or give me exact link a?

thank youHere is a tutorial.

Need sample code for asp + sql server

Hello,
I am developing for internet.
I need a good example for ASP page, that use sql-server with some update
commands + transactions (use insert/update command + beginTrans/EndTrans,
please.
Thanks
Try a site like http://www.asp101.com/ or http://www.4guysfromrolla.com/
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Avi" <nobody@.nospam_please.com> wrote in message
news:u8BcHvD8EHA.1292@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I am developing for internet.
> I need a good example for ASP page, that use sql-server with some update
> commands + transactions (use insert/update command + beginTrans/EndTrans,
> please.
> Thanks
>
|||Have a look at
http://www.mindsdoor.net/aSP/DBAccess.inc.html

Need sample code for asp + sql server

Hello,
I am developing for internet.
I need a good example for ASP page, that use sql-server with some update
commands + transactions (use insert/update command + beginTrans/EndTrans,
please.
Thanks
Try a site like http://www.asp101.com/ or http://www.4guysfromrolla.com/
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Avi" <nobody@.nospam_please.com> wrote in message
news:u8BcHvD8EHA.1292@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I am developing for internet.
> I need a good example for ASP page, that use sql-server with some update
> commands + transactions (use insert/update command + beginTrans/EndTrans,
> please.
> Thanks
>
|||Have a look at
http://www.mindsdoor.net/aSP/DBAccess.inc.html

Need sample code for asp + sql server

Hello,
I am developing for internet.
I need a good example for ASP page, that use sql-server with some update
commands + transactions (use insert/update command + beginTrans/EndTrans,
please.
Thanks :)Try a site like http://www.asp101.com/ or http://www.4guysfromrolla.com/
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Avi" <nobody@.nospam_please.com> wrote in message
news:u8BcHvD8EHA.1292@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I am developing for internet.
> I need a good example for ASP page, that use sql-server with some update
> commands + transactions (use insert/update command + beginTrans/EndTrans,
> please.
> Thanks :)
>|||Have a look at
http://www.mindsdoor.net/aSP/DBAccess.inc.html

Need sample code for asp + sql server

Hello,
I am developing for internet.
I need a good example for ASP page, that use sql-server with some update
commands + transactions (use insert/update command + beginTrans/EndTrans,
please.
Thanks Try a site like http://www.asp101.com/ or http://www.4guysfromrolla.com/
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Avi" <nobody@.nospam_please.com> wrote in message
news:u8BcHvD8EHA.1292@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I am developing for internet.
> I need a good example for ASP page, that use sql-server with some update
> commands + transactions (use insert/update command + beginTrans/EndTrans,
> please.
> Thanks
>|||Have a look at
http://www.mindsdoor.net/aSP/DBAccess.inc.html

Monday, March 12, 2012

Need Query help please...

hi...

i have the table like this,

Table Name : sample
Total Records : 500000 (Consider like this)

Sample Records:
------

id ---- name
======================
1 ----- AAA
2 ----- BBB
3 ----- CCC
2 ----- AAA
3 ----- AAA
4 ----- CCC
1 ----- BBB

i want to search based on the name, i need the id value which is must present
in the all the searching name.

i wrote the query like this... here i built the query dynamicaly.. if the search name is
increase...table self join is increase for each name... how to avoid this.. without
self join how to write the query....

My query :

Query1:
--
select a.*
from
sample a
inner join sample b on a.id=b.id
where (a.name like 'AAA' and b.name ='BBB');

Result:
---
1 ----- AAA
2 ----- BBB
2 ----- AAA
1 ----- BBB

This the result set for the above query.. but i need the unique id value.. if i
remove the duplicate.. the query will be slow...

Query2:
---
select a.*
from
sample a
inner join sample b on a.id=b.id
where (a.name like 'AA%' and b.name ='BB%');

Result:
---
1 ----- AAA
2 ----- BBB
2 ----- AAA
1 ----- BBB

This the result set for the above query.. but i need the unique id value.. if i
remove the duplicate.. the query will be slow...

But need to fine tune these query...

Is there any other simple way to get the result...?

How to avoid the self join to get the result...

Can u any one help me...?

Thanks & Regards,
S.Ashokkumar.Question : The IDs Are Not Unique ! Are They Supposed To Be ?

Could You Give A Bit More Information On What It Is Your Searching For.

If SELECT.....WHERE (a.name = 'AAA' AND b.name = 'BBB');

Then Why Not

If SELECT.....WHERE (a.name = 'AAA' AND b.name ='BBB' AND c.name = 'CCC' );

Note : If You Use LIKE, Then You Must Use Wildcards. Eg LIKE 'AA%'
If No Wildcards, Then I Think LIKE 'AAA' Is The Same As = 'AAA'

Wednesday, March 7, 2012

Need Kick in right direction w/query take 2

Bumping this up to the top, scroll down a bit to see the original thread.
--
I have updated the DDL with the actual tables and a sample of table data of
what I am actually using.
http://damageinc.org/DDL.html (The DDL is too large to post, the message
gets kicked back to me)
AFter you enter that DDL
If you run the query..
SELECT Apps.AppName, Tests.TestCase, TestCases.Type
FROM
TestCases
LEFT OUTER JOIN Apps ON TestCases.AppID = Apps.ID
LEFT OUTER JOIN Tests ON TestCases.TestID = Tests.ID
WHERE
(
(
(Proj1 = '87' OR Proj2 = '87' OR Proj3 = '87' OR Proj4 = '87' OR Proj5 =
'87')
OR
(Proj1 = '88' OR Proj2 = '88' OR Proj3 = '88' OR Proj4 = '88' OR Proj5 =
'88')
)
AND (TestCases.Card = 'G71_D' OR TestCases.Card = 'G70_D' OR TestCases.Card
= 'G72_D' OR TestCases.Card = 'G73_D')
AND TestCases.OS = 'Windows Vista'
)
GROUP BY AppName, TestCase,TestCases.Type
You will see
AppName TestCase
Type
3D Mark 2003 Benchmark: 1600x1200x32 4xAA 8x Aniso D3D Benchmarks
3D Mark 2003 Benchmark: 1600x1200x32 4xAA 8x Aniso Games
3D Mark 2003 Benchmark: Default 2x AA 4x Aniso D3D
Benchmarks
3D Mark 2003 Benchmark: Default 2x AA 4x Aniso G ames
.
.
.
.
There are 97 tests there.
What I need is that 97 for the count, then the count of the most recent
pass/fail result(s) (if there is a result) for each of those tests.
Using
Select Count(*) As 'Count',
Sum(Case When Result = 'Pass' Then 1 Else 0 End) As 'Pass',
Sum(Case When Result = 'Fail' Then 1 Else 0 End) As 'Fail'
From Reports r
Where r.ReportDate In
(Select Max(r.ReportDate)
From Reports r
Inner Join TestCases tc On r.TestCaseID = tc.ID
Inner Join Tests t On tc.TestID = t.ID
Inner Join Apps a On tc.AppID = a.ID
WHERE
(
(
(tc.Proj1 = '87' OR tc.Proj2 = '87' OR tc.Proj3 = '87' OR tc.Proj4 = '87'
OR tc.Proj5 = '87')
OR
(tc.Proj1 = '88' OR tc.Proj2 = '88' OR tc.Proj3 = '88' OR tc.Proj4 = '88'
OR tc.Proj5 = '88')
)
AND (tc.Card = 'G71_D' OR tc.Card = 'G70_D' OR tc.Card = 'G72_D' OR tc.Card
= 'G73_D')
AND tc.OS = 'Windows Vista'
)
Group By a.AppName, t.TestCase)
Gives me
Count Pass Fail
25 2 23
Which is obviously wrong, since the Count should be 97.
I have to be overthinking something here...I think this works:
SELECT Count(*) As 'Count',
Sum (Case When r.Result = 'Pass' Then 1 Else 0 End) As 'Pass',
Sum (Case When r.Result = 'Fail' Then 1 Else 0 End) As 'Fail'
From Reports r
Inner Join TestCases tc On r.TestCaseID = tc.ID
LEFT OUTER JOIN Apps a ON tc.AppID = a.ID
LEFT OUTER JOIN Tests t ON tc.TestID = t.ID
Right Join (
SELECT a.AppName, t.TestCase, tc.Type, Max(Coalesce(r.ReportDate,
'1900-01-01'))As ReportDate
FROM TestCases tc
LEFT OUTER JOIN Apps a ON tc.AppID = a.ID
LEFT OUTER JOIN Tests t ON tc.TestID = t.ID
LEFT OUTER JOIN Reports r ON r.TestCaseID = tc.ID
WHERE
(
(
(Proj1 = '87' OR Proj2 = '87' OR Proj3 = '87' OR Proj4 = '87' OR Proj5 =
'87')
OR
(Proj1 = '88' OR Proj2 = '88' OR Proj3 = '88' OR Proj4 = '88' OR Proj5 =
'88')
)
AND (tc.Card = 'G71_D' OR tc.Card = 'G70_D' OR tc.Card = 'G72_D' OR tc.Card
= 'G73_D')
AND tc.OS = 'Windows Vista'
)
GROUP BY AppName, TestCase,tc.Type) x On r.ReportDate = x.ReportDate
Tom
"Lucas Graf" <lgraf2000@.comcast.net> wrote in message
news:%23zfcKfZmGHA.3880@.TK2MSFTNGP02.phx.gbl...
> Bumping this up to the top, scroll down a bit to see the original thread.
> --
> I have updated the DDL with the actual tables and a sample of table data
> of
> what I am actually using.
> http://damageinc.org/DDL.html (The DDL is too large to post, the message
> gets kicked back to me)
> AFter you enter that DDL
> If you run the query..
> SELECT Apps.AppName, Tests.TestCase, TestCases.Type
> FROM
> TestCases
> LEFT OUTER JOIN Apps ON TestCases.AppID = Apps.ID
> LEFT OUTER JOIN Tests ON TestCases.TestID = Tests.ID
> WHERE
> (
> (
> (Proj1 = '87' OR Proj2 = '87' OR Proj3 = '87' OR Proj4 = '87' OR Proj5 =
> '87')
> OR
> (Proj1 = '88' OR Proj2 = '88' OR Proj3 = '88' OR Proj4 = '88' OR Proj5 =
> '88')
> )
> AND (TestCases.Card = 'G71_D' OR TestCases.Card = 'G70_D' OR
> TestCases.Card
> = 'G72_D' OR TestCases.Card = 'G73_D')
> AND TestCases.OS = 'Windows Vista'
>
> )
> GROUP BY AppName, TestCase,TestCases.Type
>
> You will see
>
> AppName TestCase
> Type
> 3D Mark 2003 Benchmark: 1600x1200x32 4xAA 8x Aniso D3D Benchmarks
> 3D Mark 2003 Benchmark: 1600x1200x32 4xAA 8x Aniso Games
> 3D Mark 2003 Benchmark: Default 2x AA 4x Aniso D3D
> Benchmarks
> 3D Mark 2003 Benchmark: Default 2x AA 4x Aniso G ames
> .
> .
> .
> .
>
> There are 97 tests there.
> What I need is that 97 for the count, then the count of the most recent
> pass/fail result(s) (if there is a result) for each of those tests.
> Using
> Select Count(*) As 'Count',
> Sum(Case When Result = 'Pass' Then 1 Else 0 End) As 'Pass',
> Sum(Case When Result = 'Fail' Then 1 Else 0 End) As 'Fail'
> From Reports r
> Where r.ReportDate In
> (Select Max(r.ReportDate)
> From Reports r
> Inner Join TestCases tc On r.TestCaseID = tc.ID
> Inner Join Tests t On tc.TestID = t.ID
> Inner Join Apps a On tc.AppID = a.ID
> WHERE
> (
> (
> (tc.Proj1 = '87' OR tc.Proj2 = '87' OR tc.Proj3 = '87' OR tc.Proj4 =
> '87'
> OR tc.Proj5 = '87')
> OR
> (tc.Proj1 = '88' OR tc.Proj2 = '88' OR tc.Proj3 = '88' OR tc.Proj4 =
> '88'
> OR tc.Proj5 = '88')
> )
> AND (tc.Card = 'G71_D' OR tc.Card = 'G70_D' OR tc.Card = 'G72_D' OR
> tc.Card
> = 'G73_D')
> AND tc.OS = 'Windows Vista'
> )
> Group By a.AppName, t.TestCase)
> Gives me
> Count Pass Fail
> 25 2 23
>
> Which is obviously wrong, since the Count should be 97.
> I have to be overthinking something here...
>
>