我有一个GridView,我使用ObjectDataSoure作为数据源.ObjectDataSource从TextBox和DropDownList接收参数,然后将其传递给存储过程.还有一个名为Search的按钮,可以通过提供/更改TextBox和/或DropDownList中的值来强制刷新GridView.但是我注意到如果我更改了值,我就不必单击"搜索"按钮; 只需单击GridView就会导致数据绑定.
反正仍然在使用ObjectDataSource时阻止此操作?
我想要实现的是Protractor测试从单独的数据文件(例如CSV,JSON等)中提取数据,这样我就可以在不必触摸测试脚本代码的情况下更改数据.
这可能与量角器有关吗?
我正在尝试.BAK使用C#和SMO 从文件中恢复数据库.这是我的代码.
public static void RestoreDatabase()
{
string dbConnString = Configuration.DatabaseConnectionString;
ServerConnection connection = new ServerConnection(@"dbserver\sqlexpress", "user", "password");
Server smoServer = new Server(connection);
Restore rstDatabase = new Restore();
rstDatabase.Action = RestoreActionType.Database;
rstDatabase.Database = "AppDb";
BackupDeviceItem bkpDevice = new BackupDeviceItem(@"TestData\db-backup.bak", DeviceType.File);
rstDatabase.Devices.Add(bkpDevice);
rstDatabase.ReplaceDatabase = true;
// Kill all processes
smoServer.KillAllProcesses(rstDatabase.Database);
// Set single-user mode
Database db = smoServer.Databases[rstDatabase.Database];
db.DatabaseOptions.UserAccess = DatabaseUserAccess.Single;
db.Alter(TerminationClause.RollbackTransactionsImmediately);
rstDatabase.SqlRestore(smoServer);
}
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试运行此方法时,我尝试杀死所有进程时收到以下(错误)消息:
无法使用KILL来杀死自己的进程.
如果有人能帮忙解决这个问题,我将非常感激.
我目前正在使用Coded UI编写自动化测试脚本.我在我的脚本中的各个点使用了Trace.Writeline来帮助找出测试可能失败的地方.一个这样的片段如下:
Trace.WriteLine(DateTime.Now.ToString("Enter press"));
Keyboard.SendKeys("{TAB}");
Trace.WriteLine(DateTime.Now.ToString("Tab press x 20"));
Keyboard.SendKeys("{TAB 4}");
Keyboard.SendKeys("{TAB 4}");
Keyboard.SendKeys("{TAB 4}");
Keyboard.SendKeys("{TAB 4}");
Keyboard.SendKeys("{TAB 4}");
Trace.WriteLine(DateTime.Now.ToString("Asserting Period cell state."));
Run Code Online (Sandbox Code Playgroud)
但是,当测试运行时,我得到以下输出:
2018/01/26 - 15:29:45 | Step 1
2018/01/26 - 15:30:17 | Step 2
2018/01/26 - 15:30:54 | Step 3
2018/01/26 - 15:31:08 | Step 4
2018/01/26 - 15:36:57 | Step 5
2018/01/26 - 15:42:46 | Step 6
2018/01/26 - 15:42:55 | Step 7
2018/01/26 - 15:43:04 | Step 10
2018/01/26 - 15:44:46 | Step 11
EnPer pre46 …Run Code Online (Sandbox Code Playgroud) c# ×3
.net ×2
angularjs ×1
asp.net ×1
automation ×1
gridview ×1
protractor ×1
smo ×1
sql-server ×1