| |

VerySource

 Forgot password?
 Register
Search
Author: 白饭米粉

Seeking gridview binding problem

[Copy link]

0

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-11-28 12:45:01
| Show all posts
If your audioId segment is the Key key, you can write a SQL statement to complete it.
strSQL = "select A. field, A. field,...,count(B.audioId) as commcount from A inner join B on A.audioId = b.audioId where A.UserId = "+ uid +" Group by A .Field,A,Field,...,"
Reply

Use magic Report

1

Threads

11

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-11-28 13:00:01
| Show all posts
Your count(B.*)

This,, an error, so 0 is not displayed, that is, only the "true" value is displayed
Reply

Use magic Report

0

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-11-28 13:15:01
| Show all posts
count(B.*) changed to count(B.audioId)
Reply

Use magic Report

1

Threads

11

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-11-28 13:30:01
| Show all posts
count(B.*) changed to count(B.audioId)


I tried it yesterday afternoon, and it doesn’t show up. My ID is also the primary key.
Reply

Use magic Report

1

Threads

11

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-11-28 13:45:01
| Show all posts
miosoul

           strSQL = "select A. field, A. field,..., isnull((count(B.audioId) as commcount),0) from A inner join B on A.audioId = b.audioId where A.UserId = " + uid + "Group by A. Field,A,Field,...,"



Is this writing OK,

I tried it with the query analyzer, and there was an error in AS. It can run normally without AS
Reply

Use magic Report

1

Threads

11

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-11-28 14:00:01
| Show all posts
isnull(count(B.audioId) ,0)as aa,,

This doesn’t show up, depressed
Reply

Use magic Report

1

Threads

11

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 United States

 Author| Post time: 2020-11-28 14:15:01
| Show all posts
Haha, get it done,, tired,,

Thank you

miosoul's guidance

The method I use is:


strSQL = "select A. field, A. field,..., isnull(count(B.audioId), 0)as aa from A FULL OUTER join B on A.audioId = b.audioId where A.UserId = "+ uid + "Group by A. Field,A,Field,...,"
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list