C#等效功能 [英] C# Equivalent functiion

查看:65
本文介绍了C#等效功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们我想要好像有一个C#替代品或等同于Java的结果集对象和结果集对象中的getStatemnt函数。



结果集对象和结果集对象中的getStatemnt函数。



Hey Guys I wanted to as if there is a C# alterative or equivalent to Java's

Resultset Object and the getStatemnt function in the Resultset Object.

	/**
	 * Function to close the statement object of the result set passed
	 * @param ResultSet Result Set Object
	 */
protected void closeStatement(ResultSet lObjResultSet) 
{
  try
  {
     if(lObjResultSet != null)
      {
	Statement objStatement = lObjResultSet.getStatement();
	if(objStatement != null)
        objStatement.close();
      }
  } catch(Exception e) 
    {
       System.out.println("Exception in closeStatement 2 of TransactionObject " +e.getMessage());
		}
} //end of function closeStatement





我正在尝试将这段代码从java转换为c#



请求帮助。



I am trying to convert this piece of code from java to c#

Thnks for your help.

推荐答案

SqlDataReader相当于ResultSet



更多信息 - http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx [ ^ ]



执行sql命令后,只需关闭数据库连接实例。 getStatement没有这样的等价物
SqlDataReader is the equivalent of ResultSet

More Info -http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx[^]

Just close the database connection instance after execution of sql command. There is no such equivalent for getStatement


还有另一个版本的 ResultSet 我想 - DataSet 。但这两个并不相同。

一些比较这里 [ ^ ]。



DataSet 中不存在Forward Readonly限制。
There is another version of the ResultSet I guess - the DataSet. These two are not identical though.
Some comparison here[^].

Forward Readonly restrictions do not exist in a DataSet.


这篇关于C#等效功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆