ado.net

I Can't create an ado.net transaction in IronPython

Hi, I'm trying to create an ado.net transaction in IronPython in asp.net and I'm getting the following error "couldn't find member Rollback" I tried to see what's different in my ironpython ado.net transaction with a vb.net ado.net transaction but I can't see the differences or find the reason why one doesnt work and the other does. Pe...

Get maximum value for SQL DateTime in .NET

I could swear there's a property somewhere in SqlClient to do this, but both my Google-fu and IntelliSense have abandoned me. ...

RAISERROR and returning error message to the calling application

Hi Assuming Asp.Net app calls procedure dbo.ApprovePost and @@ERROR contains a value greater than 0, then the following code will be executed: CREATE PROCEDURE dbo.ApprovePost … IF @@ERROR > 0 BEGIN RAISERROR(‘Approval of post failed’, 16, 1) ROLLBACK TRANSACTION ApprovePost RETURN 99 END COMMIT TRANSACT...

Easy way to escape sql strings?

In my code I have this everywhere command.Parameters.Add("@name", DbType.String).Value = name; Is there an easier way? I would love to do something like command.command.CommandTextFn("insert into tbl(key,val) values(?, ?);", key, value); and have it figure out if the key/value is a string or int. I wouldn't mind if I had to use {0}...

Does GridView automatically append values “ASC” or “DESC” to the value of sortExpression parameter?

When GridView implements sorting, does it automatically append string values “ASC” or “DESC” to the value of sortExpression parameter? If so, then based on what criteria does it “decide” when to append “ASC” and when to append “DESC” value? ...

How to sort a binding source with joins?

I have a table called Tenants, and it has a field called PropertyID and UnitID. I also have a binding source for this table (Tenants), however I want it sort it, but the values I want to sort it by are not in the table itself. I want to do something like this: SELECT t.*, p.PropertyName, u.UnitNumber FROM Tenants t LEFT JOIN Propertie...

Need Help about ADO.Net Transaction

I develop C# window application with Microsoft SQL Server 2005 sp3. My Application has ploblem while one of client save Order Document. Another client cannot select data from Order table util saving process is complete. I used Transaction and Isolation=ReadUncommit to save Order Document. My Application has 3 table is OrderHd, OrderLine ...

How do i escape sql and get the text instead of put it in a query?

I want to generate querys but i wont be executing. Just showing the text query after everything has been escape. I cant figure out how to get the escape value. I searched the object browser for escape hoping to find a function but i didnt. I then had a longshot idea that this (string)new SQLiteParameter("@dummy", text).Value may work but...

How can I fix Transaction with Page Lock Ploblem ?

My Application has ploblem while one of client save Order Document. Another client cannot select data from Order table until saving process is complete. I develop C# window application with Microsoft SQL Server 2005 sp3. I used Transaction and Isolation=ReadUncommit to save Order Document. My Application has 3 table is OrderHd, OrderLine...

Can I temporarily store data in my C#.Net app to reduce the need for calls for data from SQL Server?

I created a C#.net app that uses dates from a sql server 2008 database table. Is there a way for me to temporarily store the data so that my program does not have to repeatedly make server calls for the same set of information. I know how to pull the info I need and create a temporary dataset, however, it is only accessable to the part...

Object To DataView or DataSet or DataTable and back to object

We have a mish-mash app with a legacy module that still uses DataSets, DataViews and DataTables however we have most of the the databases ORMed except the DB for this Module. I was wondering if someone could give me pointers as to how to go about building extensions like /* generates a dataset called CustomerDS with DataTable called Cu...

Regarding Excel object

Hi i am using ADO.Net oledb for inserting and fetching data from Excel database. I want to make first column in the excel sheet to bold and i want to add comments. I am achieving this thru Interop.Excel Application class. i dont want to use interop. is there anyway to achieve through ADO.net query itself ? or some other way? My applic...

insert into sql query in wpf

Hello everyone i am new in wpf. so i have got problems with it. if you help me, i will be so pleased. thanks everyone in advance. My problem is, can not insert into name inside database in wpf. how can i fix it? my codes as follows; private void button1_Click(object sender, RoutedEventArgs e) { try { string SqlStr...

SqlDateTime overflow exception in Entity Framework

When calling context.SaveChange(), I get an exception: {"An error occurred while updating the entries. See the InnerException for details."} with an InnerException of "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." Generally this error is pretty easy to fix -- just find the DateTime property whos...

Dropping Oracle index w/ .NET Oracle Data Access

So my .NET utility is performing massive amounts of inserts dynamically and it would make sense to drop the index while performing these and reconstructing it after performing the inserts. Is the best way to do this using OracleCommand and setting command text to literal SQL? So for example: OracleCommand dropIndexCommand = new Oracle...

How to pass a MySQL database function as a query parameter from c#

Let me explain a little. Image you have the flowing MySQL table: CREATE TABLE test ( value DATETIME ); Currently I am doing something like this: command.CommandText = "UPDATE test SET value = ?value"; command.Parameters.AddWithValue("?value", DateTime.Now); But the clients date/time settings are unreliable so I would like the ti...

.net c sharp Console Application : timeout

I am creating a console application using Enterprise Library my code is something like this DataSet ds = db.ExecuteDataSet(command); this actually calling a SP which take 10-15 minutes to complete , so my come throws a time-out error. Any idea how to overcome this. ...

Regarding ADO.Net

What is the difference between using oledbDataReader and DataAdaptor ? Which one is best to use ? for fetching data from db... ...

Regarding ADO.Net

I have fetched some 1000 records using data adaptor and displayed in the UI(DataGrid). Now whenever user is changing the value in anyone of the row in the data grid, that particular value has to be updated into database table. Currently i am dumping the entire table again using adaptor.update. i dont want to do that...i just want to upd...

Microsoft.Net intermediate code in linux or Mac

I am working in c#.Net. Is there any way to make .Net application plateform independent? So that I can run it to any OS. Kindly give me some guideline. Thanks in advance. ...