| |

VerySource

 Forgot password?
 Register
Search
View: 724|Reply: 2

How CodeDom generates the following code, thank you, or give some tips .....

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-20 10:40:02
| Show all posts |Read mode
Field names and field types in the data table are stored in the dataset

dataset ds = ds1;

Now generate the following code:

SqlParameter [] parameters = {
new SqlParameter ("@ lm_id", SqlDbType.Int, 4),
new SqlParameter ("@ news_leixing", SqlDbType.Int, 4)
};
parameters [0] .Value = model.lm_id;
parameters [1] .Value = model.news_leixing;
Reply

Use magic Report

0

Threads

11

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-29 11:18:01
| Show all posts
Did not understand the meaning of the landlord.
Reply

Use magic Report

0

Threads

11

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-30 09:09:01
| Show all posts
It should be possible to get all the field types and names in the dataset
Then use a for loop to add what you want.
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