示例#1
0
	def Scalar(self, command, *values):
		from System.Collections import ArrayList
		list = ArrayList()
		for value in values:
			list.Add(value)
		table = self.base.Query(command, list.ToArray())
		return table.Rows[0][0]
示例#2
0
	def NonQuery(self, command, *values):
		from System.Collections import ArrayList
		list = ArrayList()
		for value in values:
			list.Add(value)
		if list.Count == 0:
			return self.base.NonQuery(command)
		elif list.Count == 1:
			return self.base.NonQuery(command, list[0])
		else:
			return self.base.NonQuery(command, list.ToArray())
示例#3
0
	def Query(self, command, *values):
		from System.Collections import ArrayList
		list = ArrayList()
		for value in values:
			list.Add(value)
		if list.Count == 0:
			for dataRow in self.base.Query(command).Rows:
				yield Row(dataRow)
		elif list.Count == 1:
			for dataRow in self.base.Query(command, list[0]).Rows:
				yield Row(dataRow)
		else:
			for dataRow in self.base.Query(command, list.ToArray()).Rows:
				yield Row(dataRow)