cursor

Passing c# DataTable as a parameter to stored procedure in MS SQL Server 2008 [closed]

别说谁变了你拦得住时间么 提交于 2019-11-30 15:43:22
I want to pass a DataDable to a stored procedure as parameter cointaning the columns below: Supp_Id int Del_Methode_Id int Ord_Ammount int Promo_Id int Discount_Ammount Money Now I want to use this datatable in stored procedure and want to declare a cursor on it. And use that cursor to insert values into the database table sequentially. Please tell me how to declare datatable parameter in stored procedure and then using cursor on that parameter ? First you need to create a type: CREATE TYPE dbo.whatever AS TABLE ( Supp_Id int, Del_Methode_Id int, Ord_Amount int, Promo_Id int, Discount_Amount

Getting SQLite database and storing it in an array of objects

只谈情不闲聊 提交于 2019-11-30 15:41:14
I'm looking at the Notes app example from the Android SDK. What I want to learn how to do is instead of using a CursorAdapter to just pass to a ListAdpater/ListView to sort out, I want to know how I can deal with the data myself; particularly in an ArrayList form. In the example, a note basically has an id, title, and body. I want to know how I can query the SQLite database and use the cursor it returns to collect the data and create object instances of an object I'll call Note which has parameters for id, title, and body. I ultimately want to store all these objects into an ArrayList for

Select running total until specific SUM is reached

坚强是说给别人听的谎言 提交于 2019-11-30 15:31:46
I am trying to select the first n rowid values from the following table variable that will get me as close to a sum(itemcount) of 200,000 without crossing that threshhold. If I was looking at this manually, I would just take the top 3 rows. I do not want to use a cursor unless there is no pure-set-based way. What is a good set-based way to get all of the rowid values "sum while/until" I get to a running total of 200,000? I looked at "running totals" at http://www.1keydata.com/sql/sql-running-totals.html but that did not seem like it would work out because the real table has around 500k rows.

pymysql 基操全套

江枫思渺然 提交于 2019-11-30 15:12:33
pymysql:python操作mysql 什么是pymysql? pymysql是一个python连接操作mysql数据的一个模块。 没有他我们就不能和mysql连接所以安装... 安装 >: pip3 install pymysql 什么是Cursor游标? 游标(Cursor)是处理 数据 的一种方法,为了查看或者处理 结果集中 的数据,游标提供了在结果集中一次一行或者多行前进或向后浏览数据的能力。 设置pymysql.cursors.DictCursor,查询的结果是字典,key是表的字段 语法 ​ conn.commit() 提交 ​ conn.cursor(pymysql.cursors.DictCursor)设置游标对象 ​ cursor.execute(sql) 执行语sql语句 ​ conn.cursor(pymysql.cursors.DictCursor)设置DictCursor ​ 特殊fetch 取 ​ 查询需要通过fetchone操作 ​ fetchmany(个数) ​ fetchall()全部 增删改查 增删改查之前需要自己创建数据库 # 选取操作的模块 pymysql # pymysql连接数据库的必要参数:主机、端口、用户名、密码、数据库 # 注:pymysql不能提供创建数据库的服务,数据库要提前创建 import pymysql from

How can I prevent fast mouse movement from breaking a line in my drawing app?

为君一笑 提交于 2019-11-30 15:03:42
I'm working on a script that allows the user to draw with the mouse: http://jsfiddle.net/ujMGu/ The problem : If you move the mouse really fast it jerks and skips a few places. Is there any way to capture all the points without any skipping black spaces in between the drawing line? CSS #myid{background: none repeat scroll 0 0 #000000; color: #FFFFFF; display: block; height: 1000px; margin: 3%; position: relative; text-indent: -1100px;}​ JS/JQ $('#myid') .css('position','relative') .unbind().die() .bind('mousemove mouseover',function (e){ var top = parseInt(e.pageY)-$(this).offset().top; var

使用python操作mysql数据库

折月煮酒 提交于 2019-11-30 15:02:10
一、pymysql的使用 1.首先在python中安装pymysql模块(CMD窗口命令下)。 pip install pymsql 安装完成后导入 import pymysql 2.pyysql 连接数据库的必要参数: 主机、端口、用户名。密码、数据库 注意:pymysql不能提供创建数据库的服务,数据库要提前创建 3.连接步骤: ​ -1. 建立数据库连接对象 conn ​ -2. 通过conn创建操作mysql的 cursor(游标对象) ​ -3. 编写sql语句交给 cursor 执行 ​ -4. 如果是查询,也要通过cursor对象,获取结果 ​ -5. 操作完毕,端口操作与连接 -1. 建立数据库连接对象 conn conn = pymysql.connect(user='用户名',passwd='密码',database='数据库名') # 例 conn = pymysql.connect(user='root', passwd='root', database='oldboy') -2. 通过conn创建操作mysql的 cursor(游标对象) 注:游标不设置参数,查询的结果就是数据元组,数据没有标识性 设置pymysql.cursor.DictCursor,查询的结果是字典,key是表的字段 cursor = conn.cursor(pymysql

How to programatically change the cursor size on a Mac

瘦欲@ 提交于 2019-11-30 14:52:40
I'd like to be able to set the system preference for cursor size (As seen in the Accessibility Preferences) on a Mac from within my program, then set it back once the program quits. Is there a way to set the cursor size (specifically) or system preferences in general from an app? First, if you're just trying to get a larger cursor when the cursor is pointing at your window/view/widget, you're going about this the wrong say. Read Introduction to Cursor Manager for the right way. Second, even if you think you actually want to set the system-wide cursor while you're program is running, think

html, css - cursor - how to change default image for pointer

非 Y 不嫁゛ 提交于 2019-11-30 14:08:44
I need to change the default image for cursor: pointer with some custom image. To create a class and specify the hover value for cursor is not a valid solution since I would have to add that class to all elements already made and is you know... not exactly optimal. Also can't add that class to body since the children with cursor: pointer would overwrite it. Any idea how to do that? Chris I need to change the default image for cursor: pointer with some custom image. I misunderstood that at first, but after reading this comment , things were clearer. You can do this easily using jQuery

Moving mouse pointer on Android screen programmatically

不羁岁月 提交于 2019-11-30 13:52:13
I am developing an Android application where I would like to move the "mouse" pointer/cursor on an Android tablet. I know this is possible because when I connect a mouse (USB or BT) to an Android tablet (Honeycomb+), a cursor appears and I can interact with the tablet using the mouse only. I would like to control that mouse from Java on the Tablet. I already have a second device that can communicate the tablet and which can stream pointer coordinates to it. And no I can't use bluetooth. The second device that I'm using has WiFi but no ability to drive BlueTooth. My thought is that there must

change cursor to busy while page is loading

我只是一个虾纸丫 提交于 2019-11-30 13:46:10
I understand how to use javascript to change the cursor to busy while the page is making and ajax call. However I have a page that does not use ajax, it uses a postback to reload the page. However the load is rather data intensive and it takes a few seconds. During this time the user can still click on the page. I want to turn the cursor to "waiting" so the user does not try to click on the page. For example I have a couple of dropdowns that cause postback. I make a selection and the page loads for 3 seconds. While it loads I would like the cursor to turn to waiting so the user does not try to