| |

VerySource

 Forgot password?
 Register
Search
View: 726|Reply: 3

Creating controls with code

[Copy link]

2

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-8 12:20:01
| Show all posts |Read mode
As the title

 SqlDataSource conn = new SqlDataSource ();
        conn.ConnectionString = ConfigurationManager.ConnectionStrings ["xinkepc_data"]. ToString ();
        conn.ProviderName = ConfigurationManager.ConnectionStrings ["xinkepc_data"]. ProviderName;
        conn.SelectCommand = "select * from ad";

How to set the ID of the control
Reply

Use magic Report

0

Threads

13

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-9 17:45:01
| Show all posts
conn.ID = "SqlDataSource1";
Reply

Use magic Report

2

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-10 15:45:01
| Show all posts
Which of your above is getting the ID instead of setting the ID
Reply

Use magic Report

2

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-10 17:00:01
| Show all posts
Which does not work upstairs, conn.ID is used to get the ID instead of setting the ID
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