xxxxxxxxxx
const loadpic = () => {
return new Promise((resolve, reject)=>{
sql.connect(config).then(
pool =>{
return pool.request()
.input('Names',TYPES.Char,'Roger')
.query('select Email from Account where Names=@Names')
.then((result) =>{
sql.close();
resolve(result);
}).catch(err =>{
if(err) console.log(err);
sql.close();
reject(err);
})
}
)
})
}
loadpic()
.then(result =>{console.log(result)})
.catch(err=>{if(err) console.log(err)})
xxxxxxxxxx
<select class="form-select">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
xxxxxxxxxx
var columns = records.First()
.Properties
.Select((x, i) => new {Name = x.Name, Index = i})
.ToArray();
foreach (var column in columns)
{
var binding = new Binding(string.Format("Properties[{0}].Value", column.Index));
dataGrid.Columns.Add(new DataGridTextColumn() {Header = column.Name, Binding = binding });
}
xxxxxxxxxx
SELECT Employee, Prénom AS 'First Name', Nom_de_famille AS 'Last Name' FROM Employés AS Employees'
xxxxxxxxxx
SELECT dept_id, COUNT(*) AS total
FROM employees
GROUP BY dept_id;