Hi, I need advice. I have asp.net web service and winforms client app.
Client call this web method and get dataset.
1. [WebMethod]
2. public DataSet GetSecureDataSet(string id)
3. {
4.
5.
6. SqlConnection conn = null;
7. SqlDataAdapter da = null;
8. DataSet ds;
9. try
...
it show me this error Incorrect syntax near the keyword 'Select' to make to clear Employee ID in this case is FK in the table (Attendance detail) and the other thing is i am using Data Grid View from another table(Employee information) to Show the list of the staff in my form. then i want to transfer each selected cell value from Data...
I need two tables and two sets of fields, not the name of the foreign key and one of the table names. Does anyone know how to query SQL Server for complete foreign key information? Thanks!
...
Hi,
I have a System.Data.DataTable which is populated by reading a CSV file which sets the datatype of each column to string.
I want to append the contents of the DataTable to an existing database table - currently this is done using SqlBulkCopy with the DataTable as the source.
However, the column data types of the DataTable need to ...
How can I get the previous version of data of a Row in a DataTable? The data has only changed but hasn't been saved yet.
The .NET version I'm working on is 1.1
...
a) SqlCommand.ExecuteNonQuery is used for update, insert and delete operations.
Besides the fact that by using ExecuteNonQuery instead of ExecuteReader we automatically know there won’t be any query results returned, are there some other benefits/reasons why ExecuteNonQuery should be used?
b) Similarly, if we want a database operation...
How is it possible to execute a direct SQL command to an ADO.NET connected database?
I want to send a DBCC SHRINKDATABASE to the SQL server, to compress the current datafile after a big deletion process. The function ObjectContext::CreateQuery returns a parser error after the DBCC command. Is there any other way to shrink the database f...
When using SqlCommand to call a stored proc via RPC, it looks like it is possible to call a stored proc in a database other than the current database.
e.g. :
string storedProcName = "SomeOtherDatabase.dbo.SomeStoredProc";
SqlCommand cmd = new SqlCommand(storedProcName);
cmd.CommandType = CommandType.StoredProcedure;
I'd like to m...
I have a populated SqlCommand object containing the command text and parameters of various database types along with their values. What I need is a T-SQL script that I could simply execute that would have the same effect as calling the ExecuteNonQuery method on the command object.
Is there an easy way to do such "script dump" or do I ha...
How to fill multiple tables in a dataset.
I m using a query that returns me four tables.
At the frontend I am trying to fill all the four resultant table into dataset.
Here is my Query. Query is not complete. But it is just a refrence for my Ques
Select * from tblxyz compute sum(col1)
suppose this query returns more than one table...
How to filter DataView/DataTable by time? I have a table with datetime column inside and I need to filter by the time that is inside that datetime value. In native SQL it's not so hard but in ADO.NET Expressions it makes a dificulity for me.
...
I'm trying to call a stored procedure using ADO .NET and I'm getting the following error:
ORA-01460 - unimplemented or
unreasonable conversion requested
The stored procedure I'm trying to call has the following parameters:
param1 IN VARCHAR2,
param2 IN NUMBER,
param3 IN VARCHAR2,
param4 OUT NUMBER,
param5 OUT NUMBER,
param6 OUT ...
Hi,
I'm trying to write an application that has two DataGrids - the first one displays customers and the second one selected customer's records. I have generated the ADO.NET Entity Model and the connection property are set in App.config file. Now I want to populate the datagrids with the data from sql ce 3.5 database which does not suppo...
I need some expert advice on strong typed data sets in ADO.NET that are generated by the Visual Studio. Here are the details. Thank you in advance.
I want to write a N-tier application where Presentation layer is in C#/windows forms, Business Layer is a Web service and Data Access Layer is SQL db.
So, I used Visual Studio 2005 for this...
I fill a DataSet and allow the user to enter a search string. Instead of hitting the database again, I set the RowFilter to display the selected data. When the user enters a square bracket ( "[" ) I get an error "Error in Like Operator". I know there is a list of characters that need prefixed with "\" when they are used in a field nam...
My development machine is running Windows 7 Enterprise, 64-bit version. I am using Visual Studio 2010 Release Candidate. I am connecting to an Oracle 11g Enterprise server version 11.1.0.7.0. I had a difficult time locating Oracle client software that is made for 64-bit Windows systems and eventually landed here to download what I assume...
Hello,
for example I'm trying to get the data from database like:
using (ExplorerDataContext context = new ExplorerDataContext())
{
ObjectQuery<Store> stores = context.Store;
ObjectQuery<ProductPrice> productPrice = context.ProductPrice;
ObjectQuery<Product> products = context.Product;
...
I am going to use the DAAB to prevent a lot of manual labor in my database intensive application. But before I get started I would like to know if there would be any noticeable perfoemce differences between using the native ado.net datareader and the DAAB.
...
How do I build a connection string which includes a passsword having a "=" in it? (I'm connecting to MySql 5.1)
For example, let's say the password is "Ge5f8z=6", what would the connection string look like?
I tried:
Server=DBSERV;Database=mydb;UID=myuser;PWD="Ge5f8z=6";
and
Server=DBSERV;Database=mydb;UID=myuser;PWD=Ge5f8z=6;"
Bo...
I'm just learning the WCF entity framework (and .net in general), and I'm running into a problem specifying lock hints in an embedded SQL query. I'm trying to specify a query that has lock hints in it (e.g., "SELECT * FROM xyz WITH(XLOCK, ROWLOCK)") and I keep getting errors from the runtime that the query syntax is not valid. The quer...