ado.net

Passing OracleLob as parameter to a function

可紊 提交于 2020-01-15 11:42:09
问题 I want to accomplish a similar thing: try { openConnection(); OracleCommand cmd = new OracleCommand("SELECT CUSTOMER_ID, IMAGE_BLOB FROM CUSTOMER_IMAGE WHERE CUSTOMER_ID IN (3026)", conn); string pubID = ""; OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess); //create the report object MemoryStream memStream; DataSet ds = new DataSet(); DataTable ImageTable = new DataTable(); BinaryReader binReader; DataRow dr; byte[] byteArrName; OracleLob blob; while (reader.Read(

How to get multiple selected items in asp.net listbox and show in a textbox?

廉价感情. 提交于 2020-01-15 10:09:53
问题 i am trying to add the selected items from the listbox to the textbox with the comma seperated between each other. but it is only reading the first element of the selected items every time.if i select three values holding ctrl its only passing the fist elemnt of selected items if (ListBox1.SelectedItem != null) { // int count = ListBox1.SelectedItems.Count; if (TextBox1.Text == "") TextBox1.Text += ListBox1.SelectedItem.ToString(); else TextBox1.Text += "," + ListBox1.SelectedItem.ToString();

how to insert row in SQL database in ADO.Net Connection oriented mode

Deadly 提交于 2020-01-15 09:44:07
问题 I have a database in which a table has name Registration which is used to register the user. It has only two column one is Username and one is password . A page named Register.aspx is used for registering the member which have two textbox one is for taking Username(textbox1) and one is for taking password(textbox2) and one button for insert these value in database. The Main problem is that we cannot write statement like this : Insert into Registration (Username, password) values ('TextBox1

SNIReadSync executing between 120-500 ms for a simple query. What do I look for?

醉酒当歌 提交于 2020-01-15 06:20:08
问题 I am executing a simple query against SQL Server 2005: protected static void InitConnection(IDbCommand cmd) { cmd.CommandText = "set transaction isolation level read uncommitted "; cmd.ExecuteNonQuery(); } Whenever I profile with dotTrace 3.1, it claims that SNIReadSync method is taking between 100 - 500 ms. What sort of things do I need to be looking for in order to get this time down? Thanks! 回答1: I have not tested, but would wonder if you have the same issue if you used a TransactionScope

provider for PostgreSQL in .net with support for TransactionScope

和自甴很熟 提交于 2020-01-15 03:43:10
问题 is there some library for connecting to postgresql database and to have support for TransactionScope I tried Npgsql but it doesn't yet support transactionscope 回答1: You could try the library from Devart: http://www.devart.com/dotconnect/postgresql/ 来源: https://stackoverflow.com/questions/3819569/provider-for-postgresql-in-net-with-support-for-transactionscope

Most efficient way to read XML in ADO.net from XML type column in SQL server?

我只是一个虾纸丫 提交于 2020-01-14 14:52:06
问题 With a XML type column in SQL server, what is the most efficient way to read this back into an XmlDocument in ADO.Net? For this particular use, an XmlDocument is needed for random-access to the loaded document. Using .Net 4.0 (C#) and SQL Server 2008 R2. Originally, we had a stored procedure that was returning a result set. When calling SqlDataAdapter.Fill(DataTable) to obtain the results, the XML is returned only as a string . I then changed this to have the T-SQL return an output parameter

Should I wrap a task in another task or should I just return the created task?

穿精又带淫゛_ 提交于 2020-01-14 09:49:06
问题 I'm building a .NET 4.0 application that uses ADO.NET, so I cannot use async/await. I don't want a solution for that, but I do want to know what of the following implementations is best and why. My unit tests pass for all three implementations, but I want to know the difference between these three. #1 Nesting tasks In my first implementation I wrap a task in another task. I think spinning up two tasks is bad for performance, but I'm not sure. public virtual Task<IDataReader>

Import from Excel to Sql Table

喜欢而已 提交于 2020-01-14 05:36:06
问题 I have excel sheet and I have 5 columns all are of type VARCHAR's. I have a Table called Details and has 5 columns all of type VARCHAR's. I have to import the data from Excel to table every day. I am manually copying the records from excel and pasting them into the sql table. This approach is easy and quick. But I want to make it automated. Can I do it through the coding by giving the location of Excel Sheet. I am using SQL 2005 and Excel 2007. Any suggestions or directions please. Thank you.

Retrieve Datareader using Objects

青春壹個敷衍的年華 提交于 2020-01-14 05:35:10
问题 I have worked on retrieving the data from SQL database using Datareader and populate it in Datatable.. But, I am wondering whether is there any way to handle the data from datareader without using datatable ? I mean- handling the table values using Objects should be more preferable.. But, I dont want to use LINQ here since, I am going to use ADOMD object to pull the data from database(Cubes).. 回答1: Have a look at dapper-dot-net. I'm not sure how it works with ADOMD.NET, but it does neatly

Optimal way to handle .dbf from C#

丶灬走出姿态 提交于 2020-01-14 03:53:27
问题 What data-provider can I use to update .dbf file from C#? I tried a few different .dbf providers to create a DataSource but I get a message like this: "Error Message: ERROR HYC00 Microsoft ODBC dBase Driver Optional feature not implemented." Or when I generated a dataset and a dataadapter with an update function I got: "Update requires a valid UpdateCommand when passed DataRow collection with modified rows." If anyone knows some way to work on .dbf from C# with lots of updates please help.