是否可以确定用户是否处于非活动状态,并在使用angularjs说不活动10分钟后自动将其注销?
我试图避免使用jQuery,但我找不到有关如何在angularjs中执行此操作的任何教程或文章.任何帮助,将不胜感激.
我正在尝试将数据连接添加到使用SQLite的datagridview.我已经添加了对SQLite的引用(下载了所需的文件)但是当我通过向导添加数据源时,SQLite不包含在选项中 - 请参见下面的截图:
我环顾四周寻找这个问题的答案,但没有成功找到任何问题.
以下是项目文件夹中数据库的屏幕截图:
有没有办法将datagridview绑定到sqlite数据源?
任何帮助,将不胜感激.
谢谢!
我正在尝试在我的Windows窗体应用程序中填充数据网格视图,但是当我执行select查询时,没有从数据库返回任何内容.我在本网站上查看了有关此主题的其他问题,但无法找到解决我问题的任何问题.
数据视图表的名称是qbcMemDataView,数据源是一个名为sqlite_dbDataSet1的sqlite数据集
这是我的代码:
public Form1()
{
InitializeComponent();
dbConnection = new SQLiteConnection("Data Source=sqlite_db.sqlite;Version=3");
dbConnection.Open();
string[] restrictions = new string[4];
restrictions[2] = "test_table_mom";
using (DataTable dTbl = dbConnection.GetSchema("Tables", restrictions))
{
for (int i = 0; i < dTbl.Rows.Count; i++)
{
tblChooser.Items.Add(dTbl.Rows[i].ItemArray[dTbl.Columns.IndexOf("TABLE_NAME")].ToString());
}
if (tblChooser.Items.Count > 0)
{
tblChooser.SelectedIndex = 0;
}
}
}
private void btnSelect_tbl_Click(object sender, EventArgs e)
{
string sql = "SELECT id, name FROM test_table_mom";
using (SQLiteDataAdapter dbAdapter = new SQLiteDataAdapter(sql, dbConnection))
{
DataTable dataTbl = new DataTable();
dbAdapter.Fill(dataTbl); …Run Code Online (Sandbox Code Playgroud) 我通过ajax调用将post参数传递给控制器动作时遇到了一些问题.我不确定它为什么要这样做,因为其他ajax调用按预期执行.我得到的回应如下:
Notice: Undefined index: user_bio in C:\xampp\htdocs\module\Members\src\Members\Controller\ProfileController.php on line 149
Run Code Online (Sandbox Code Playgroud)
控制器代码是:
public function changebioAction()
{
$layout = $this->layout();
$layout->setTerminal(true);
$view_model = new ViewModel();
$view_model->setTerminal(true);
if ($this->request->isPost()) {
try {
$params = $this->params()->fromPost();
$this->getProfileService()->editProfile(array('bio' => ltrim($params['user_bio'])));
} catch (ProfileException $e) {
$this->flashMessenger()->addErrorMessage($e->getMessage());
return $this->redirect()->toRoute('members/profile', array('action' => 'change-failure'));
}
}
return $view_model;
}
Run Code Online (Sandbox Code Playgroud)
javascript和html:
// handle quick edit of bio
function quickEditBio(element, button) {
var edited_data = $(element).html();
var data = $(element).blur(function() {
edited_data = $(element).map(function() {
return this.innnerHTML;
}).get();
});
$(button).on('click', …Run Code Online (Sandbox Code Playgroud) 最近我遇到了我正在创建抛出异常的C#程序的问题Could not find file C:\windows\system32\qbcdb.mdb.这很奇怪,因为在通过Advanced Installer部署我的程序之前,我从未遇到过这个问题.我没有改变任何东西,但由于某种原因,这个错误不断发生(例外框的屏幕截图 - http://imgur.com/1GLhwmg).
我不知道在这个问题中包含什么来帮助更多地解释我的问题,所以这是我的App.config文件(在网站上阅读它可能与之相关,但同样,我从来没有遇到任何问题所以远):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="QBC.Properties.Settings.qbcdbConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\qbcdb.mdb"
providerName="System.Data.OleDb" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
Run Code Online (Sandbox Code Playgroud)
插入db方法:
#region inserts the data into the database
private void InsertData()
{
using (dbConn)
{
dbConn.Open();
using (dbCmd = new OleDbCommand("INSERT INTO members (household_head, birthday, phone, email, address, status, spouse, spouse_birthday, spouse_phone, spouse_email, " +
"anniversary, spouse_status, child1, child1_birthday, child1_email, " +
"child2, child2_birthday, child2_email, child3, …Run Code Online (Sandbox Code Playgroud) 我正在尝试让分页器分割页面上显示的组数,但出于某种原因,当我尝试转到下一组数据或页面时,它会默认返回主布局和索引页面.我不确定为什么这是因为我之前做过这个并且工作正常.
这是我的代码:
路线:
'groups' => array(
'type' => 'Segment',
'options' => array(
'route' => '/groups[/:action][/:id]',
'constraints' => array(
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Members\Controller\Groups',
'action' => 'index',
),
),
),
'paginator' => array(
'type' => 'Segment',
'options' => array(
'route' => '/groups/view-more/[page/:page]',
'constraints' => array(
'page' => '[0-9]*',
),
),
'defaults' => array(
'controller' => 'Members\Controller\Groups',
'action' => 'view-more',
),
),
Run Code Online (Sandbox Code Playgroud)
控制器 -
public function viewmoreAction()
{
$paginator = new Paginator(new DbTableGateway($this->getGroupsTable()));
$page = 1;
if …Run Code Online (Sandbox Code Playgroud) 是否可以仅在DataGridView具有值的行中打印列并排除非空列?我正在尝试打印那些并且只有那些存储了实际值的那些,但是现在它正在打印所有这些.
以下是实际打印文档的屏幕截图(以pdf格式保存):http://imgur.com/HiF9heq
我想消除其余的空列.
这是我打印的代码和填充数据表的代码:
private void Printdoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
try
{
qbcDataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
// set the left margin of the document to be printed
int leftMargin = e.MarginBounds.Left;
// set the top margin of the document to be printed
int topMargin = e.MarginBounds.Top;
// variable to determine if more pages are to be printed
bool printMore = false;
// temp width
int tmpWidth = 0;
// for the first page to print, …Run Code Online (Sandbox Code Playgroud) 我在PHP中使用glob函数来浏览目录并尝试仅匹配图像文件.这是有效的,但是当我尝试计算每个目录中的图像时,它会重复其他目录的第一个目录的计数.例如,目录1有6个图像,目录2有4个图像但是当我尝试显示每个目录的计数时,它显示目录2的6个图像,依此类推.
这是我的代码:
public function viewphotoalbumsAction()
{
$identity = $this->identity();
$dirname = array();
$files = array();
foreach (glob(getcwd() . '/public/images/profile/' . $identity . '/albums/*', GLOB_ONLYDIR) as $dir) {
$dirname[] = basename($dir);
foreach (glob($dir . '/*.{jpg,png,gif}', GLOB_BRACE) as $images) {
$files[] = $images;
}
}
//var_dump($files); exit;
$data = array(
'albums' => array_values($dirname),
'files' => $files,
);
return new ViewModel(array('album' => $data['albums'], 'files' => $data['files']));
}
Run Code Online (Sandbox Code Playgroud)
var_dump()的结果
array(9) { [0]=> string(96) "C:\xampp\htdocs/public/images/profile/fooboy/albums/bone mom's album_2017-07-03/massive snow.jpg"
[1]=> string(91) "C:\xampp\htdocs/public/images/profile/fooboy/albums/bone mom's album_2017-07-03/mom-jon.jpg"
[2]=> string(90) …Run Code Online (Sandbox Code Playgroud) 我正在尝试让每个单元格的数据彼此正确对齐,但对于一列,内容与其他单元格不相符.我不知道为什么会这样,因为我查看了所有默认样式和其他布局/外观选项,没有什么是不寻常的.我不知道这是否有帮助,但这是在调试模式下运行的程序的屏幕截图.
这只是由于某种原因关闭的电子邮件列.如果需要,我可以尝试提供更多信息.
谢谢
我让其他人排队,但仍然遇到电子邮件列的问题
这真的令人沮丧,对我来说毫无意义.设计师代码是否有用于查看?如果需要,我可以提供.
更新 -
我注意到每个DGV的第4栏(电子邮件).除第4列外,其他所有内容都排好了.有任何想法吗?
更新2 -
以下是InitializeComponent方法中datagridview的代码:
//
// dataGridView
//
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView.AutoGenerateColumns = false;
this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
this.dataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.dataGridView.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.idDataGridViewTextBoxColumn,
this.firstnameDataGridViewTextBoxColumn,
this.lastnameDataGridViewTextBoxColumn,
this.phonenumberDataGridViewTextBoxColumn, …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行我制作的程序(通过高级安装程序创建安装程序),但它一直说无法打开数据库(sqlite)文件。我检查了路径,我认为它们是匹配的,因为它在 Visual Studio 中运行得很好。App.config 连接字符串是:
<connectionStrings>
<add name="db" connectionString="Data Source=qbc-members.sqlite;Version=3;" />
</connectionStrings>
Run Code Online (Sandbox Code Playgroud)
这是项目目录内位置的屏幕截图:
这是实际的异常消息:
正如我所说,在 Visual Studio 中调试时它会按预期运行。当我检查程序的安装位置(C:\Program Files (x86)\user\qbc)时,它显示目录内的 sqlite 数据库文件以及实际的 .exe 文件。所以我真的很困惑为什么它找不到文件(当我尝试查找答案时,我认为相关的答案是它找不到文件)。这是实际程序目录(安装后)的屏幕截图。
如您所见,该文件就在那里。关于为什么抛出此异常有什么想法吗?
任何帮助,将不胜感激。
谢谢!
(抱歉,如果我的问题不清楚,请告诉我,如果需要,我会尝试添加更多信息)。
我在使用fullcalendar保存结束时间时遇到了一些问题,并且可以将其拖动到日历上超过一天.我已将它设置为通过jQuery.post将数据保存到我的数据库,但我似乎无法弄清楚如何获得最终值以填充以及将其拖动超过一天的能力.这是我的代码:
var calendar = $('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay',
},
editable: true,
selectable: true,
selectHelper: true,
select: function (start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent', {
title: title,
start: start,
end: end,
}, true);
}
calendar.fullCalendar('unselect');
},
eventDrop: function (event, dayDelta, minuteDelta) {
alert(event.title + ' was saved!');
jQuery.post(
'/event/save',
{
title: event.title,
start: event.start,
end: event.end
}
);
}
});
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激!谢谢
(如果能帮助任何人确定问题,我也可以提供网址)
c# ×6
datagridview ×3
sqlite ×3
javascript ×2
php ×2
.net ×1
ajax ×1
angularjs ×1
fullcalendar ×1
jquery ×1
ng-idle ×1
pagination ×1