all groups > dotnet ado.net > november 2007
Filter by week: 1 2 3 4 5
Detect If SqlConnection Is In Use?
Posted by JonOfAllTrades at 11/30/2007 1:49:02 PM
I'm sure this has been answered before, but I couldn't find the right search
terms.
We've all seen how a single SqlConnection can only serve one SqlDataReader
at a time. However, often one needs to query within a queried loop.
Typically, I'd create a second SqlConnection called "innerLoopCo... more >>
Disconnected app with sql server compact
Posted by John at 11/29/2007 3:29:32 PM
Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when l... more >>
DataSet.xsd and Locale
Posted by Dimitris Milonas at 11/29/2007 9:39:16 AM
Hello,
When I build a DataSet with the DataSet Designer (DataSet.xsd) every
DataTable has the property "Locale" which is set (I guess) to the current
collate of the table of the SQL Server (I'm using MSSQL). I want to build a
web application which is language neutral or translated in two or... more >>
Loading Large XML
Posted by Debasish Pramanik at 11/29/2007 4:23:00 AM
We do a FOR XML query using SQLXMLReader.ExecuteXMLReader() method. The
results is obtained in a XMLReader. We then load XMlDocument using XmlReader
as we have to process the XML.
When we try to fire a query which returns huge data, the query executed by
database is 6 seconds but to load ... more >>
Batch Insert/Updates
Posted by Dimitris Milonas at 11/28/2007 8:52:14 AM
Hello to all,
I would like to inserts/delete some records from a table and Update the
DataAdapter at the end of all the operations. The problem is that I would
like the intermediate changes to be visible in the User Interface (i.e.
DetailView). I am using the following code:
DataRow Data... more >>
TransactionScope Error
Posted by tim at 11/28/2007 2:53:00 AM
I wrap two updates from different tableadapters in a transactionscope. They
are connected to the same databese. By runing the program I get an error
message: Communication with the underlying transaction manager has failed.
Error HRESULT E_FAIL has been returned from a call to a COM component.... more >>
Will You Use LINQ?
Posted by Jonathan Wood at 11/27/2007 10:14:18 PM
So, VS2008 is now available (http://www.asp.net/). One thing I'm now
wondering about is how much sense LINQ makes.
I've been reading of all the advantages of stored procedures: more secure,
more efficient, and better organization of code associated with a database.
To the extent that's true... more >>
Need More ADO Suggestions
Posted by Jonathan Wood at 11/27/2007 7:41:54 PM
I'm still trying to get a handle on ASP.NET and ADO.NET.
Since there is a bit of code involved in executing a procedure, I thought
I'd stick it in it's own routine.
So I tried the following. I was able to determine this does not work
because, apparently, the reader requires that the connec... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
dataadapter vs tableadapter - whats the difference?
Posted by HONOREDANCESTOR@yahoo.com at 11/27/2007 2:41:55 PM
I have a book called "Hitchhiker's Guide to Visual Studio and SQL
Server". It has a chapter on using dataAdapters, and another chapter
on using tableAdapters. The problem is, they seem to overlap in what
they can do, and I don't know when I would use one and when I would
use the other? Furthe... more >>
ADO.net 2.0 Error on line 51 authentication mode=Windows of web.co
Posted by Jeffrey at 11/27/2007 12:24:03 PM
To run an example from ADOnet 2.0 SBS 2005 edition, I opened a web site from
File System (Microsoft Press folder). I can review the Design and Source
tabs; however, running an example program, e.g. Chap 14-Finished, showed the
following error:
It is an error to use a section registered as... more >>
Rek:TPVS Consultant (Transportation Planning and Vehicle Scheduling):Colorado
Posted by ronald.holzwart@gmail.com at 11/27/2007 11:48:53 AM
Hi,
Please find the requirement below and answer ASAP with updated resume
and contact details....
----------------------------------------------------------------------------------------------------------------------------------------------------------
TPVS Consultant (Transportation Planning an... more >>
How to get a column size in VB.net
Posted by Vanny at 11/27/2007 8:04:47 AM
How could I get a column size from a datareader or a datatable? We're
moving from VB6 where the code looks like this: rcs.Fields(i).Size (rcs is
a recordset).
Thank for your help
Vanny
... more >>
How skip a row in gridview with code?
Posted by Cirene at 11/26/2007 7:38:12 PM
I have a databound gridview.
How do I skip a row if a certain condition exists? (In VB.NET)
For example...
Protected Sub GridView2_RowDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView2.RowDataBound
If e.Row.RowTyp... more >>
DataTable foreign key
Posted by Emre DÝNÇER at 11/26/2007 2:52:42 PM
Dear All,
is it possible to extract the DataColumn which is a foreign key of another
table.
foreach (DataRelation dr in dsIlce.Tables[0].ParentRelations) {
Console.WriteLine("123");
console.WriteLine(dr.ParentTable.TableName.ToString());
}
prints nothing unfortunately..
than... more >>
Linq2Sql issues
Posted by gerry at 11/26/2007 11:40:09 AM
I am looking at Linq2Sql in VS2008 and have run into a couple of things :
<Short Version>
1 - Linq To Sql designer has problems with multi-level namespace. View
Code generates error "The name SimpleNS.SubNS is not a valid identifier.
Please choose a different name." code generated ignor... more >>
Context Connection & Using
Posted by Scott M. at 11/24/2007 3:35:35 PM
When working with the SQL CLR, should I be using "using" when referring to
the "context connection"?
... more >>
Provider factory for Mobile / Compact Framework
Posted by Larry at 11/23/2007 9:56:53 PM
Hello,
I am about to write an app for Pocket PC 2003 / Windows CE / Mobile 5 (don't
know which yet) from which I need to query both SQL Server Express 2005 and
SQLCe. I would like to be able to use a provider factory to not have to
duplicate code.
ADO 2.0 has DbProviderFactory, but it i... more >>
Problem with BindingSource and saving ...
Posted by Yen at 11/23/2007 10:40:59 AM
I created simple forms with wizard. From a DataSources I dragged table to
form. VB GDI created DataSet, BindingSource and BindingNavigator controls. I
code, I have for Save Button:
Me.Validate()
Me.DicInvSymBindingSource.EndEdit()
Me.DicInvSymTableAdapter.Update(Me.AfbDbDataSet.DicInvSym)
... more >>
Named DataSets with Grids, How to enable a SqlServer Application role
Posted by Harry Leboeuf at 11/22/2007 12:11:38 PM
Hello,
I'm a novice in .Net development (switched after 10 years Delphi).
I've created a small test app with a Dataset in it.
The Dataset contains a TableAdapter.
In my Form i'm using a grid that uses that named dataset to display an
update the table.
Now i would like to enable a applicat... more >>
Linq To Sql-Beginners Q: can't Add new record (Add() method missin
Posted by Sky at 11/21/2007 6:11:00 PM
Hello:
Downloaded VS2008 trial from MS 24 hours ago in order to investigate Linq To
Sql.
But I'm hitting a strange roadblock, where I am unable to find an Add()
method on the dataContext's tables... And without, I can't add a new record.
What I have done:
a) As I said, its a trial vers... more >>
SqlTransaction.BeginTransaction() within TransactionScope bad?
Posted by haroldsphsu@gmail.com at 11/21/2007 4:57:54 PM
Hi all,
I have some existing code that updates the database by creating a
SqlCommand and SqlTransaction:
public class GroupMapper
{
public static void Update(Group g)
{
// Gets SqlConnection, creates SqlCommand and calls
SqlConnection.BeginTransaction().
}
}
That... more >>
using a DataAdapter to insert with identity column
Posted by Andy Fish at 11/21/2007 4:31:15 PM
hi,
i am using a DataAdapter and DataSet to insert rows into a table which has
an identity column
I would expect that once I have executed the update, the field in the
corresponding DataRow would have been updated to reflect the newly allocated
id, but this does not seem to be the case.
... more >>
Table Field Set To Not Allow Nulls
Posted by JimHeavey at 11/21/2007 8:12:02 AM
I have a table with 2 keys, which are of course identified as not being
allowed to be null. I have created a screen in which has a number of fields
identified for selection criteria, and the user has the freedom to identify
which fields it will use to make their selection on. Sometimes they ... more >>
DataAdapter W/Parameters
Posted by JimHeavey at 11/20/2007 9:27:01 PM
I used VS2005 to Created a Dataset and TableAdapter and a number of queries
for my Oracle Table. I created a "BLL" class to handle my Business Logic
Layer. One of the "Select" query has selection criteria for a number of
fields. I added at GridView to my form and bound my grid to the table... more >>
I have a CLR function thet returns IEnumberable (a table) and it has a FillRow function. I am returning 10,000 integers from this function. Is there a
Posted by DR at 11/19/2007 7:41:02 PM
I have a CLR function thet returns IEnumberable (a table) and it has a
FillRow function. I am returning 10,000 integers from this function. Is
there any way that I can preallocate the resulting table or give SQL server
hint as to how many rows my function will return? It makes me cringe to
t... more >>
reading data from an excel spreadsheet - is it supposed to be easy?
Posted by Andy Fish at 11/19/2007 11:00:17 AM
ok, so after a few dead ends I have got this far:
1. using visual studio 2005, create a new blank windows forms project and
add a data source
2. create a new connection, select data source as "other" then select ".net
framework data provider for oledb"
3. select "microsoft jet 4.0 ole d... more >>
Inserting taking to long time System.Data.OracleClient
Posted by vviktorsson@hotmail.com at 11/19/2007 8:21:19 AM
Hi I hope I'm in the right group. I'm accessing a lot of data from a
WebService that returns me a DataSet. I need to insert the Data set
into an Oracle Database version 9. It's taking about an hour to loop
throug this 40.000 rows and I think thats to long. Here is how I'm
doing it:
Oracl... more >>
SqlDataAdapter.Update questions
Posted by JJ at 11/19/2007 6:49:00 AM
I'd like to know exactly how an UpdateCommand determines that there are
concurency issues, specifically if I have supplied I created my own update
command, instead of using the SqlCommandBuilder.
The issue I am facing is I have setup a column in my DataTable to map to an
output parameter in... more >>
Why isn't my SCOPE_IDENTITY() working?
Posted by news.microsoft.com at 11/17/2007 4:26:55 PM
I have a table called Activities with a primary key of ActivityId which is
an identity field. I can see the value after the insert is there. But my
return back from the ExecuteScalar method call is not working.
private const string SQL_INSERT_ACTIVITY = "INSERT INTO
APActivities(ActivityN... more >>
Getting a subset of DataRows from a DataTable
Posted by Nathan Sokalski at 11/16/2007 8:19:04 PM
I have a DataTable from which I only need a certain range of the DataRows.
What I would like to do is copy a range of rows from one DataTable to a new
DataTable like the following:
For i As Integer = start To last
table1.Rows.Add(table2.Rows(i))
Next
However, the code above gives an err... more >>
how does SqlCommandBuilder work?
Posted by Andy Fish at 11/16/2007 7:29:09 PM
hi,
I have seen by example that in order to use an SqlCommandBuilder, you just
have to instantiate it.
however, when trying to figure out what was happening, I looked in
reflector, and I can see that the SqlCommandBuilder constructor doesn't
actually do anything except store a reference ... more >>
Fill typed dataset with one stored procedure call
Posted by Gene at 11/16/2007 8:45:04 AM
Is it possible to fill a strongly typed dataset with multipe tables single
stored procedure command?
... more >>
Trouble appling filter to datatable.defaultview
Posted by moondaddy at 11/15/2007 9:44:55 AM
Using vb.net 2.0 I'm trying to filter a dataview. From the code examples
I've seen, it looks correct, but its not having any effect. The datatable
has about 250 rows of data. after I apply the filter and set the dataview
as the datasource, I still see all of the rows. However, when I step ... more >>
OleDbCommandBuilder - Data type mismatch in criteria expression
Posted by john at 11/15/2007 9:00:51 AM
Hi, i'm using an OleDbCommandBuilder to update data from a dataset to a
access database.
It work fine, but if i use a table with a decimal column data type, i
get this error, when performing the update
Data type mismatch in criteria expression
i've understood that the error is due to the ... more >>
syntax for filter in datatable.select
Posted by moondaddy at 11/14/2007 9:55:27 PM
Where can I find documentation for the syntax allowed in the filter used in
datatable.select("some filter")?
I want do something like this:
dim str as string = "men"
datatable.Select("colName Like "*" & var & "*")
which would allow data like
mentor
document
etc.
Thanks.
--
... more >>
prompt user to select from recordset.
Posted by Kevin O'Brien at 11/13/2007 3:56:23 PM
Hey guys,
I am querying a sql database for a matches using wild cards. If I return
more than one record I want to prompt the user to choose the best match.
What is the best way to do this? I thought I could put the matching records
into a label and have the user select the item that they ... more >>
Performance issue with vS2005
Posted by touf at 11/13/2007 12:39:01 AM
Hi,
I've migrated from VS2000 (1st version of VS.NET) to VS2005,I'me having some
performance isssues
for example a query "Select * from table" that return 70000rows is taking
more than 1 min (instead of 5 sec in the previous version)
The same query takes 1 sec when I run it in the sql server ... more >>
Reading a SQLCLR Stored Proc. Result
Posted by Scott M. at 11/12/2007 2:48:07 PM
How do you consume the result of a SQLCLR stored procedure when it returns a
SQLDataRow?
Thanks.
... more >>
ADO.NET Sync Partial Table
Posted by JStorm at 11/12/2007 2:25:04 PM
Is it possible to use the ADO.NET 2008 Sync Framework to sync only a portion
of a table?
Syncing the entire table is not an option for the app I am working on due to
the sheer size of the table, so I was wanting to apply business requirements
to the sync logic.
If it is possible, can som... more >>
Help! Stored Procs don't show as Data Sources In Data Source Window
Posted by Scott M. at 11/12/2007 11:39:40 AM
a. I have some SQL CLR stored procedures and a connection to that SQL
database in my Server Explorer.
b. I use the Add Data Source Wizard and select my stored procedures as the
items I'd like to add.
c. When done, I get a DataSet with the DataSet designer showing one
TableAdapter c... more >>
Data reader / Serverside cursor
Posted by rbrowning1958 at 11/11/2007 8:13:20 AM
Hello,
New to ADO.NET so apologies in advance for repeating what I am sure
has been asked been before. I have read that a data reader is much
like a Server Side cursor. I understand this but have one questtion. I
use a SQL Command object to execute a Select statement, then a data
reader to re... more >>
sql server setting concat_null_yields_null
Posted by touf at 11/11/2007 12:16:54 AM
I'm migrating from ms-accss to sql server 2005 for a vb.net application.
the problem is that the queries like "select field1+field2 from table"
arereturning NULL if one of the fields is null.
I like to have the concatenation containing the not null values.
I've tried to set the variable conca... more >>
Indexes for Foreign Key Constraints?
Posted by Joel Lyons at 11/9/2007 3:51:05 PM
I read recently in an ADO.NET book that I should create indexes on foreign
key constraints if they will commonly be used when joining. I can't
remember where, but I could swear that I had read somewhere else that
indexes were automatically created when you assign a foreign key constraint
to... more >>
What is the best way to connect to a cube?
Posted by David Thielen at 11/8/2007 4:45:00 PM
Hi;
1) Is there a url that discusses the best way to do this using ADO.NET (and
pretending it's a SQL database)?
2) Is there a url that shows the best way to access it as a cube taking full
advantage of all cube functionality?
--
thanks - dave
david_at_windward_dot_net
http://www.wi... more >>
Problems adding a calculated field to an existing dataset.
Posted by B. Chernick at 11/7/2007 11:34:01 AM
I'm doing a project in Winforms VB/Dot 2.0. I have an existing xsd.
What I would like to do is add a calculated field to a table. This column
would simply be a concatenation of 2 other fields, both fixed length char
fields, (The expression field is simply field1name + field2name).
I'... more >>
command.CommandText and parameters
Posted by skneife@gmail.com at 11/7/2007 9:11:43 AM
What is the way for getting the sqlQuery with all params
replacementfrom a command ?
DbCommand command;
SqlParameter sqlParam = new SqlParameter("@param1", "value1");
SqlParameter sqlParam = new SqlParameter("@param1", "value2");
command.CommandText=sqlQuery;
What is the propertoie that provid... more >>
tableadapter configuration fails with stored procedures and temp t
Posted by MarcG at 11/7/2007 7:25:02 AM
This issue was raised in posts from 2005 to 2007. The Feedback article dated
2005 at ...
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=106244&wa=wsignin1.0
provides a workaround that leaves a maintenance headache. I have experienced
the problem with a sto... more >>
select a slice of records from a position
Posted by skneife@gmail.com at 11/7/2007 2:02:46 AM
I need to get a range of records from a specific position like Limit
start,numberOfRecords in mySql:
Example a table with columns name and age:
id name age
1 John 20
2 Peter 31
3 Mike 18
....
150 Andrew 45
Now I need to get a slice of records that r... more >>
Saving a (whole) datatable in SQL Server 2000
Posted by Pipo at 11/6/2007 8:24:15 PM
Hi,
I would like to save (and load) an entire datatable into SQL Server 2000.
Is this possible and has someone has some sample (code) for me?
tia,
Pipo... more >>
Saving a whole datatable to SQL server 2000
Posted by Pipo at 11/6/2007 8:18:35 PM
Hi,
I am looking for some sample (code) on how to save a complete datatable into
SQl server 2000.
I want to save the datatable (filled with datarows and values) and later on
I need to load it back again.
Does anyone know if this is possible and how?
tia,
Pipo
... more >>
|