| |

VerySource

 Forgot password?
 Register
Search
View: 728|Reply: 1

Complex DataBinding accepts IList or IListSource as a data source

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-2-16 17:00:01
| Show all posts |Read mode
I made a simple electronic photo album during the exercise
Use C # + Access
"Complex DataBinding accepts IList or IListSource as data source" when binding data to DDL

Related Source
// Binding DDltype
private void BindDateToDll ()
{
BLL.addPhoto addPhoto = new frPhoto.BLL.addPhoto ();
this.ddlType.DataSource = addPhoto.BindToDdlType (). Tables [0] .Columns [1];
this.ddlType.DisplayMember = "Tname";
this.ddlType.ValueMember = "Tid";
Ranch

}

********************************
public DataSet BindToDdlType ()
{
string str = "select Tid, Tname from Type order by Tid desc";
return DAL.DataOper.OpBindDs (str);
}
********************************
public static DataSet OpBindDs (string str)
{
DBConn newCon = new DBConn ();
OleDbConnection conn = newCon.CreateDbCon ();
try
{
OleDbDataAdapter oda = new OleDbDataAdapter (str, conn);
DataSet ds = new DataSet ();
oda.Fill (ds);
return ds;
}
catch
{
throw;
}
}


Use a simple three-tier architecture, please give pointers! !!
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-19 12:15:02
| Show all posts
this.ddlType.DataSource=addPhoto.BindToDdlType().Tables[0].Columns[1];
To
this.ddlType.DataSource=addPhoto.BindToDdlType().Tables[0]
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