这是我的工作班:
public class Job
{
public string Id{ get; set;}
public string Name{ get; set;}
}
Run Code Online (Sandbox Code Playgroud)
这是我的ListView:
public class JobListePage:ContentPage
{
// Members
private ListView lstView;
// Constructor
public JobListePage ()
{
// Set members
lstView = new ListView ();
// Create job objects
Job[] jobs = {new Job(){Id="1", Name="Benny"}, new Job(){Id="2", Name="Lukas"}};
// Fill listview with job objects
lstView.ItemsSource = jobs;
// HOW CAN I PASS THE TAPPED OBJECT HERE???
lstView.ItemTapped += async (o, e) => {
await DisplayAlert("Tapped", …Run Code Online (Sandbox Code Playgroud) 我已在所有项目上安装 EF 版本 6.1.3。然后我创建了一个模型类、一个上下文类,并在我的本地计算机上安装了一个 MSSQL 数据库(我没有做任何其他事情)。一切都很完美(不知何故它知道我的本地数据库)。
型号类别:
public class Account
{
public int Id { get; set; }
public string Name{ get; set; }
}
Run Code Online (Sandbox Code Playgroud)
数据上下文类:
public class MyClassDataContext: DbContext
{
public DbSet<Account> Accounts{ get; set; }
}
Run Code Online (Sandbox Code Playgroud)
应用程序配置:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Run Code Online (Sandbox Code Playgroud)
然后我尝试将其移动到远程数据库,但它不起作用。我尝试了一切。 …
c# sql-server entity-framework connection-string remote-server
当我在perl中执行以下操作时,我总是得到错误代码"0".即使例如mysql数据库不存在,或密码错误等.
@args = ("mysqldump -u root -ppassword database1 | gzip -c > /usr/local/bin/database.gzip");
system(@args) == 0
or die "Command failed: @args \nError Code: $? \n";
Run Code Online (Sandbox Code Playgroud)
我的目标是捕获mysqldump命令的任何错误,因此我可以确保备份是否成功.