Dataset.fill Error In Sqlserver2000 + ASP.net 2.0

Jun 12, 2006

Hi,
I am unable to load data in dataset via sqlconncetion object. Always i get error at ds.fill.

Thanks in advance. PLS Help.

Sudipta Datta
 www.geocities.com/dattasudipta 

View 1 Replies


ADVERTISEMENT

How To Fill A Dataset?

May 11, 2006

Can a SqlDataSource be used to fill a DataSet? If so, will you show me how it's done?

View 2 Replies View Related

Unable To Fill Dataset

Apr 26, 2008

I'm trying without success to do a select command against the dataadapter and then fill a dataset. I'm using VS 2008, and I've set my project to the 2.0 framework. What is wrong is I get an empty dataset (The count on the dataset = 0. )with the code below. The database is connecting fine, so I assume it's something to do with the commandtext. The database is SQL CE 3.5.

Any ideas would be appreciated.





Code Snippet

Public Shared Function Init() As DataSet
'Todo: need to encrypt the password
Dim instance As New SqlCeConnection("Data Source=|DataDirectory|PBdata.sdf")
Dim selectcmd As SqlCeCommand = instance.CreateCommand
selectcmd.CommandText = "Select * From [dusers]"
Dim adp As New SqlCeDataAdapter(selectcmd)
Dim ds As New DataSet("dusers")
adp.Fill(ds)

Return ds

End Function

View 1 Replies View Related

DataSet Fill Using Cmd.Parameters - Legal?

Jan 2, 2007

A - Must Declare variable @ZipEntry - error generates when I run the code below.  If I hard code the "WHERE ZipCode = 72364" it works (display messed up but it works - don't know how to code in the line breaks yet).  But when I try to pass in the value of a TextBox called txtZipEntry on the page I get this error.  Am I not delcaring @ZipCode in the correct spot ?
Thank you,
public partial class ContractorResultsDisplay : System.Web.UI.Page{string ZipEntry;protected void Page_Load(object sender, EventArgs e){
ZipEntry = txtZipEntry.Text;SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["localhomeexpoConnectionString2"].ConnectionString);string sql = "Select [City], [StateCode], [AreaCode], [Latitude], [Longitude], [ZipCode] From [ZipCensus11202006] Where ZipCode > @ZipEntry";SqlCommand cmd = new SqlCommand(sql, con);cmd.Parameters.AddWithValue("@ZipEntry", ZipEntry);SqlDataAdapter da = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();da.Fill(ds, "ZipCodeRefs");StringBuilder htmlStr = new StringBuilder("");
foreach (DataRow dr in ds.Tables["ZipCodeRefs"].Rows){htmlStr.Append(dr["City"].ToString());}
ZipContent.Text = htmlStr.ToString();
}
}

View 1 Replies View Related

Fill DataSet Using Stored Procedure

Jul 21, 2005

The following is NOT filling the dataset or rather, 0 rows returned.....The sp.....CREATE PROCEDURE dbo.Comms
@email   NVARCHAR ,@num    INT OUTPUT ,@userEmail    NVARCHAR OUTPUT ASBEGIN DECLARE @errCode   INT
SELECT   fldNum, fldUserEmailFROM tblCommsWHERE fldUserEmail = @email SET @errCode = 0 RETURN @errCode
HANDLE_APPERR:
 SET @errCode = 1 RETURN @errCodeENDGOAnd the code to connect to the sp - some parameters have been removed for easier read.....
Dim errCode As Integer
Dim conn = dbconn.GetConnection()
Dim sqlAdpt As New SqlDataAdapter
Dim DS As New DataSet
Dim command As SqlCommand = New SqlCommand("Comms", conn)
command.Parameters.Add("@email", Trim(sEmail))
command.CommandType = CommandType.StoredProcedure
command.Connection = conn
sqlAdpt.SelectCommand = command
Dim pNum As SqlParameter = command.Parameters.Add("@num", SqlDbType.Int)
pNum.Direction = ParameterDirection.Output
Dim pUserEmail As SqlParameter = command.Parameters.Add("@userEmail", SqlDbType.NVarChar)
pUserEmail.Size = 256
pUserEmail.Direction = ParameterDirection.Output
sqlAdpt.Fill(DS)
Return DS
Like I said, a lot of parameters have been removed for easier read.And it is not filling the dataset or rather I get a count of 1 back and that's not right.I am binding the DS to a datagrid this way....
Dim DScomm As New DataSet
DScomm = getPts.getBabComm(sEmail)
dgBabComm.DataSource = DScomm.Tables(0)
And tried to count the rows DScomm.Tables(0).Rows.Count and it = 0Suggestions?Thanks all,Zath

View 7 Replies View Related

Fill A Dataset In Visual Studio 2005

Oct 13, 2006

this may seem like a real newbie question, but I got no clue how to solve this problem.  When I was working in Visual Studio 2003, whatever I wanted to fill a dataset with data, I was using a SqlDataAdapter that I created like this adapTest.Fill(dsTest); But now, I cant seem to find the sqldataadapter anywhere, I can just create (on the visual interface of one of my page of my aspx project) dataset, but cant find anywhere a adapter to put an SQL instruction into...maybe theres a new way to do this in Visual Studio 2005 that I dont know about.  Im not sure if I was clear enough, but what I want in the end is to be able to use my dataset like that dsTest.Tables.Rows[0]["a column"].ToString()by filling the dataset with data like I was able to do in VS2003.  Thanks for taking the time to read this.

View 3 Replies View Related

Fill DataSet Takes Forever, Query Db 7 Sec

Jan 16, 2007

Hi,
I got a weird problem. I've created a sp that takes in the query analyzer 7 seconds to run. When i put in my code dataAdapter.Fill(dataSet.Tables(0)) it takes forever to finish!!
What's going on?
Any thoughts highly appreciated.
t.i.a.,ratjetoes.

View 2 Replies View Related

Counting Result Set From SQL Query Before Fill()ing A DataSet

Mar 6, 2007

I need to display something like "Results x-y of z."  The problem is, I can't figure out how to get the right value for z.I am using SqlDataAdapter and Fill()ing a DataSet with subset x through y of the result set.  How can I get the right value for z?

View 5 Replies View Related

How To Fill Dataset With Parameterized SELECT Statement

Dec 17, 2007

 Hello,
I have been reading about how you shouldn't build dynamic SQL statements (see TextBox1.Text in line 3)  and should use parameters instead, but I haven't yet found how to create a SELECT statement with a parameter that fills a dataset. If anyone can show me the correct way of doing this I would appreciate it so I can add it to my code snippets for proper coding practices. Thanks in advance for any assistance.           
            string strConnectionString =   ConfigurationManager.ConnectionStrings["sqlConnectionString"].ConnectionString;
            SqlConnection myConnection = new SqlConnection(strConnectionString);
 ->       string sqlSelect = "select * from customers where city = " + "'" + TextBox1.Text + "'";
            SqlDataAdapter da = new SqlDataAdapter(sqlSelect, myConnection);
            DataSet ds = new DataSet();
            myConnection.Open();
            da.Fill(ds, "myDataset");
            myConnection.Close();
 
jcfrasco
                    

View 1 Replies View Related

Character String Query Doesn't Fill Dataset

Mar 15, 2007

I'm working in a ASP.NET 2.0 application with a SQL Server 2000 database on the back end.  I have a strongly typed dataset in the application that calls a stored procedure for the select.  I'm having trouble filling the dataset at runtime though.
I am trying to use a character string query because I setup different columns to be pulled from a table each time and in a different order so my T-SQL looks like this:
set @FullQuery = 'Select ' + @FieldsinOrder + ' from tblExample'exec (@FullQuery)
This works fine in query analyzer.  The results return and display correctly.  However, when I run the application, the dataset does not get filled.  It is like the results do not output to the application.
If I change the query to be a normal select it works.  For example:
select * from tblEmample
That works fine.  What is it about a select query setup as a character string and then executed that ASP.NET doesn't like?

View 1 Replies View Related

How Do I Get The OUTPUT Parameter Value From A Stored Procedure That I Am Using To Fill A Dataset?

May 10, 2007

View 6 Replies View Related

SQL Express Goes Out To Lunch In Visual Studio After Failing To Fill A DataSet

Aug 24, 2006

I have an off the wall situation that occurs when I try to fill a dataset that has already been filled with data. The issue with the DataSet in and of itself was a mistake I made and is not relevant to this forum.

What would appear to be relevant though, is the fact that after the exception was caught, I could not longer query data from the SQL Express database that was included in my project. In other words, when I tried to view the data in the IDE by selecting "Show Table Data," I received a message telling me that the query was running and eventually it timed out.

To fix the problem in my application, I obviously eliminated the bad code. But to be able to query the database again, I had to physically restart my computer (yes, I probably could have restarted the service, I know).

So my question is, has anyone run into this phenomenon before? If so, is there a way to prevent it other than the obvious, which is to clear the DataTables in my DataSet before filling them?

It's not that big a deal, but it is kind of a pain in the rear to have to restart everything because of a stupid coding mistake on the client side while I'm developing an app.

View 1 Replies View Related

UNABLE TO CONNECT TO SQLSERVER2000 FROM VS2005 .How To Enable Remote Connection On Sqlserver2000

Sep 10, 2007



Hi,

iam having vs2005 installed on my machine and i also installed sqlserver2005 dev edition on my machine...Now iam devloping a Window Appplication in which I need to populate a grid from Sqlserver2000 (dev edition) which installed on remote (i.e another network)....when i try to run my application it gives me a error tht "Unable to connect to sqlserver2005".actaully i specified in my connection string to connect to Sqlserver2000 on the remote machine.


I feel to know how to enable remote connection on Sqlserver 2000.So tht i can access this sqlserver2000 from another machine

With regards
Mahender

View 1 Replies View Related

How To Select A Specific Value From Dataset To Fill A Specific Cell ?

Mar 27, 2007

Hi there !

Thanks for taking the time to read this thread.

I don't know whether anyone has this problem, but I am definitely not using the right keywords to search for a thread.

My situation is this...

I have a dataset that has values to fill cells to multiple tables in a report.
However, I only want to select specific data from the dataset to fill textboxes and others.
I cannot change the stored procedure, but the sample of the data is shown below:-


Row Stat Val
0 dtRpt1 02/01/2005
1 Value1 1
2 Value2 2000
3 dtMailSent 02/28/2005
4 Value3 0
5 Value4 5
6 Value5 658

I know it looks weird, but the row really represents which "row" or textbox is it to fill with the Val. The Stat Column is just a way to make sure that I am filling the right values.

so my new report would have multiple tables to denote different categories.
In my first table, I tried putting the cells as follows:-
(expressions are highlighted in italics and bold)

TextBox1 =IIF(Fields!Row.Value =0, Fields!Val.Value,"")

Table1
Column1
DetailRow1 =IIF(Fields!Row.Value =1, Fields!Val.Value,"")
DetailRow2 =IIF(Fields!Row.Value =2, Fields!Val.Value,"")


Table2
Column1
DetailRow1 =IIF(Fields!Row.Value =3, Fields!Val.Value,"")
DetailRow2 =IIF(Fields!Row.Value =4, Fields!Val.Value,"")
DetailRow3 =IIF(Fields!Row.Value =5, Fields!Val.Value,"")
DetailRow4 =IIF(Fields!Row.Value =6, Fields!Val.Value,"")


I only expect this report to print out one page holding the previous values.

However, it ended up printing like this

----------------------------------------------------------

Table1
Column1
DetailRow1 1
DetailRow2

Column1
DetailRow1
DetailRow2 2000


Table2
Column1
DetailRow1 02/28/2005
DetailRow2
DetailRow3
DetailRow4

Table2
Column1
DetailRow1
DetailRow2 0
DetailRow3
DetailRow4

Table2
Column1
DetailRow1
DetailRow2
DetailRow3 5
DetailRow4

Table2
Column1
DetailRow1
DetailRow2
DetailRow3
DetailRow4 658

------------------------------------------------------

I tried putting it into the headerrows instead of DetailRows, and it ended up printing the last value.
Is there anyway to do this ? print all the values out in one table ? I tried using textboxes, but I think I got my expression wrong.

Is this the correct expression ?

=IIF((Fields!Row.Value,"Dataset") =1, (Fields!Val.value, "Dataset"), "")

and it give me an error
The value expression for the textbox €˜textbox5€™ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

Appreciate any advice or suggestion for this scenario !

Thanks!

Bernard

View 3 Replies View Related

Error On Win98 And Sqlserver2000

Aug 23, 2006

Wilson writes "Hi, I have Sql Server 2000 on win98, i can't retrieve any data. Instead, it shows an error, says that some files is missing or is not registered.

the mssql was reinstalled and it's goin then same.

what could be the problem? what could be the solution?"

View 1 Replies View Related

Error In Connecting To The Databse(sqlserver2000)

Apr 7, 2008

hiam working with VS2005(asp,c#),sql server2000.
i uploaded my application to the webserver.when i try to interact with database in my webpages.it is giving error
error:An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)
 
actually am using   sqlserver2000,but it is giving error regarding 2005.how can i resolve this.
my web.config settings are like this.. 
<?xml version="1.0"?><!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
WindowsMicrosoft.NetFrameworkv2.xConfig
--><configuration>
<appSettings>
<add key="cn" value="User ID=redot;Password=redot;Data Source=216.185.43.148:8077;Initial Catalog=redot" />
 <!--<add name="redotConnectionString" connectionString="Data Source=REDOT;Initial Catalog=redot;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>-->
 
 <!--<add key="smtpServer" value="smtp.mydomain.com" />-->
</appSettings><connectionStrings>
<!--<remove name="LocalSqlServer"/>--><!--<add name="ConnectionString" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot; Password=redot"providerName="System.Data.SqlClient" />-->
 
<add name="redotConnectionString" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString1" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString2" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString3" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString4" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString5" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString6" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString7" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString8" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString9" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
<add name="redotConnectionString10" connectionString="Data Source=216.185.43.148:8077;Initial Catalog=redot;User ID=redot;Password=redot"providerName="System.Data.SqlClient" />
</connectionStrings><system.web>
 
 
 
 <sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=216.185.43.148:8077;User ID=redot;Password=redot;Trusted_Connection=True"cookieless="false" timeout="60"
/>
<compilation debug="true" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user. -->
 
 
 <!--<customErrors mode="Off"></customErrors>-->
<!--<customErrors mode="On" defaultRedirect="error.aspx"/>--><!--<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />-->
 <customErrors defaultRedirect="http://seafarersjobs.com/errorStatus.htm" mode="On">
 <error statusCode="404" redirect="filenotfound.htm" />
</customErrors></system.web>
<system.net><mailSettings>
<smtp><network host="216.185.54.55" port="25" />
<!--password="123456" userName="redot"--></smtp>
</mailSettings></system.net>
</configuration>
 
 
 
 
can anyone help me ASAP ..pls
 
 
Thanks
Shobha

View 4 Replies View Related

SQLServer2000 - Error Logs Change Loc

Jun 14, 2004

The SqlServer2000 error logs go to Program FilesMicrosoft SQL ServerMssqlLog directory by default.

How can I change their location. I could change SqlServerAgent logs but did not find any help or way to change the location of these. Would anyone please help?

Thanks
Vinnie

View 3 Replies View Related

Failed To Install Sqlserver2000 W/out Error Msg

Mar 26, 2008

hi... i need help.
i tried to install sql server 2000 on my laptop (WinXP os) and when i reach the form where im supposed to click "Install Database Server", the next form after clicking "Install Database Server" wont show, and there are no error messages. I tried everything i could but it didnt work. My last choice is to format my computer - but i dont want to do that.

there are two processes running on the background that has SQL in its name - SETUPSQL.EXE and SQLSTP.EXE. I think this shows that the setup is still running.

i need help asap please, and i dont want to format my computer...

thanks in advance!

View 2 Replies View Related

Error On DataAdapter.fill

Apr 11, 2006

i have this code :

if(! IsPostBack)
            {
           
    string strConnection = "server=localhost; uid=sa;
pwd=sasasa; database=northwind";
                string strCommand = "Select * from Customers";

           
    SqlDataAdapter dataAdapter = new
SqlDataAdapter(strCommand, strConnection);

                DataSet dataset = new DataSet();

                dataAdapter.Fill(dataset, "Products");
           
    SqlCommandBuilder bldr = new
SqlCommandBuilder(dataAdapter);

                DataTable dataTable = dataset.Tables[0];
                dgCustomer.DataSource = dataTable;
                dgCustomer.DataBind();
            }

when i run this code, error like this appear :


Server Error in '/Registeration' Application.


SQL Server does not exist or access denied. Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied.Source Error:



Line 41: DataSet dataset = new DataSet();Line 42: Line 43: dataAdapter.Fill(dataset, "Products");Line 44: SqlCommandBuilder bldr = new SqlCommandBuilder(dataAdapter);Line 45: Source File:
e:asp.net
egisteration
egister.aspx.cs    Line: 43
Stack Trace:



[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) System.Data.SqlClient.SqlConnection.Open() System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) Registeration.WebForm1.Page_Load(Object sender, EventArgs e) in e:asp.net
egisteration
egister.aspx.cs:43 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()

Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573

how can i solve this problem??? thank you...

View 1 Replies View Related

Error In DataAdapter.Fill

Apr 11, 2006

i have this code :

private void Page_Load(object sender, ....)
{

if(! IsPostBack)

            {
           
    string strConnection = "server=localhost; uid=sa;
pwd=**secret**; database=northwind";

                string strCommand = "Select * from Customers";


           
    SqlDataAdapter dataAdapter = new
SqlDataAdapter(strCommand, strConnection);



                DataSet dataset = new DataSet();



                dataAdapter.Fill(dataset, "Products");
           
    SqlCommandBuilder bldr = new
SqlCommandBuilder(dataAdapter);



                DataTable dataTable = dataset.Tables[0];

                dgCustomer.DataSource = dataTable;

                dgCustomer.DataBind();

            }
}



when i run this code, error like this appear :




Server Error in '/Registeration' Application.


SQL Server does not exist or access denied. Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied.Source Error:



Line 41: DataSet dataset = new DataSet();Line 42: Line 43: dataAdapter.Fill(dataset, "Products");Line 44: SqlCommandBuilder bldr = new SqlCommandBuilder(dataAdapter);Line 45: Source File:
e:asp.net
egisteration
egister.aspx.cs    Line: 43
Stack Trace:



[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) System.Data.SqlClient.SqlConnection.Open() System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) Registeration.WebForm1.Page_Load(Object sender, EventArgs e) in e:asp.net
egisteration
egister.aspx.cs:43 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()

Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573



how can i solve this problem??? thank you...

View 1 Replies View Related

Error With Execute Sql Task And Full Result Set: Not Been Initialized Before Calling 'Fill'

Oct 10, 2006

This is the first time I've tried creating an "execute sql task" with a "full result set".

I've read in the documentation that I must set the resultname to 0, which is done, and that the variable must be of type object. Also done.

[Execute SQL Task] Error: Executing the query "select * from blah" failed with the following error: "The SelectCommand property has not been initialized before calling 'Fill'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Has anyone else had success with a full result set?

Thanks,
-Lori

View 10 Replies View Related

Arithmetic Overflow Error Converting Expression To Data Type Int When Using Fill From A SqlDataAdapter

Mar 7, 2007

I thought I'd post this quick problem and answer, as I couldn't find the answer when searching for it. 
I tried to call a stored procedure on SQL Server 2000 using the System.Data.SqlClient objects, and was not expecting any unusual issues.  However when I came to call the Fill method I received the error "Arithmetic overflow error converting expression to data type int."
My first checks were the obvious ones of verifying that I'd provided all the correct datatypes and had no unexpected null values, but I found nothing out of order.  The problem turns out to be a difference on the maximum values for integers between C# and SQL Server 2000.  Previously having hit issues with SQL Server integers requiring Long Integer types in VB6, I was aware that these are 32-bit integers, so I was passing in Int32 variables.  The problem was that Int32.MaxValue is not a valid integer for SQL Server.  Seeing as I was providing an abitrary upper value for records-per-page (to fetch all in one page), I was simply able to change this to Int16.MaxValue and will hit no further problems as this is also well beyond any expected range for this parameter.
 If anyone can name off the top of their heads what value should be provided as a maximum integer for SQL Server 2000, this might be a useful addition, but otherwise I hope this spares others some hunting if they also experience this problem.
James Burton

View 1 Replies View Related

Data Adapter FILL Causing Data Corrupt Error In C# Web Service

Apr 2, 2008

I hope someone has seen this one...I've got a very simple web method that returns a DataTable from my database. It worked fine until I changed this line of code:

string SqlString = @"SELECT Timestamp, Confession FROM Confessions WHERE ConfessionID = ? ORDER BY Timestamp desc";

To this line of code:

string SqlString = @"SELECT Timestamp, Confession FROM Confessions WHERE ConfessionID = ? AND CategoryID = ? ORDER BY Timestamp desc";


Here is the complete webmethod:

[WebMethod]
public DataTable GetConfession (int ConfessionID, int CategoryID) {

DataTable dt = new DataTable();
dt.TableName = "XMLConfession";

string SqlString = @"SELECT Timestamp, Confession FROM Confessions WHERE ConfessionID = ? AND CategoryID = ? ORDER BY Timestamp desc";

using (OleDbConnection cn = new OleDbConnection (ConnectionString)) {
using (OleDbCommand cmd = new OleDbCommand (SqlString, cn)) {

cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue ("@ConfessionID", ConfessionID);
cmd.Parameters.AddWithValue ("@CategoryID", CategoryID);
cn.Open();

OleDbDataAdapter da = new OleDbDataAdapter (cmd);

da.Fill (dt);
}
}

return dt;
}
To cause the error, all I did was add the AND statement into the query. Now I get this .NET error message every time I try to run this program:


System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Data.Common.UnsafeNativeMethods.ICommandWithParameters.SetParameterInfo(IntPtr cParams, IntPtr[] rgParamOrdinals, tagDBPARAMBINDINFO[] rgParamBindInfo) at System.Data.OleDb.OleDbCommand.ApplyParameterBindings(ICommandWithParameters commandWithParameters, tagDBPARAMBINDINFO[] bindInfo) at System.Data.OleDb.OleDbCommand.CreateAccessor() at System.Data.OleDb.OleDbCommand.InitializeCommand(CommandBehavior behavior, Boolean throwifnotsupported) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

I am using SQL Server Compact Edition 3.5 and C# .NET 2.0. It's worth noting that the web service does this outside of the program as well, so I don't think the problem is in the code that calls it. Also worth noting is that the query itself works fine when I substitute values in and run it in .NET Server Explorer.

Thanks in advance for any assistance.

View 5 Replies View Related

Error Using More Than One Dataset

Nov 3, 2006

Hi,

I have a problem using more than one dataset to create my report. I wish to use data from one stored procedure to create the values for a combobox, that I use as input to another stored procedure.

When I create more than one dataset and set up my report parameters to use one of them to create comboboxes, I get the following error, when I want to see the preview:

An error occured during local report processing.

The definition of the report '/StockInTrade' is invalid.

The data set name is missing in the data region 'DataSetName'

------------------------------

The report worked just fine when I used hardcodede values for my combobox. The error occurs as soon as I define more than one dataset (meaning it fails even before I try to use the second dataset as report parameter values).

Does anyone know what I am doing wrong?

-- Heidi :-)



View 3 Replies View Related

Dataset Cannot Be Generated Error

Jan 5, 2006

When editing the data driven subscription query I SOMETIMES get the following error: The dataset cannot be generated. An error occurred while connecting to a data
source, or the query is not valid for the data source. (rsCannotPrepareQuery) Invalid object name '##XX'. The datasource is ok, authentication also, the query works... Why can't it see the temporary table?

View 6 Replies View Related

Dataset Update Method Error?

Oct 26, 2007

I have a gridview and a dataset. When I start my application I see the results in my gridview. When I clic on edit and chanche some value and click on update it wil give me this error:ObjectDataSource 'ObjectDataSourcePersoon' could not find a non-generic method 'Update' that has parameters: naam, tussenvoegsel, achternaam, adres, woonplaats, telefoonnummer, original_id, Original_naam, Original_tussenvoegsel, Original_achternaam, Original_adres, Original_woonplaats, Original_telefoonnummer. Does someone know whats the problem??

View 10 Replies View Related

ConstraintException Error While Filling Dataset?

Nov 15, 2006

Hi,

  I always get a "ConstraintException" error when trying, at beginning of application, to run following statement (within "Form1_Load" routine called by "this->Load" EventHandler):

"this->TauxTaxeTableAdapter->FillByPays(this->TauxTaxeDataSet->TauxTaxe,Cur_GrdView_SlPays);"

  Also curiously if, while application is still running, I invoke again that same statement by means of a pushbutton clickevent,  everything is running smootly without error...  Looks to me that it is bugging only when running the first time...

  Within Dataset, I tried to see what constraint could give me such trouble.  Here is the only constraint I could find:

"this->Constraints->Add((gcnew System::Data::UniqueConstraint(L"Constraint1", gcnew cli::array< System::Data::DataColumn^ >(2) {this->columnPays, this->columnProvince_Etat}, true)));" 

  I then tried to find within "TauxTaxe" table if there could be any trace of records where "Pays" and "Province_Etat" columns would show any null value as well as any duplicate key values but there wasn't any... 

  Any place I should start to look for?  BTW, I'm using a SQL Express database.

Thanks for your help,

Stéphane

Here is the detailed error log I got:

System.Data.ConstraintException: Impossible d'activer les contraintes. Une ou plusieurs lignes contiennent des valeurs qui violent les contraintes de type non null, unique ou de clé externe.
   Ã System.Data.DataSet.FailedEnableConstraints()
   Ã System.Data.DataSet.EnableConstraints()
   Ã System.Data.DataSet.set_EnforceConstraints(Boolean value)
   Ã System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
   Ã System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   Ã System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   Ã System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   Ã Test_ADO.DS_TauxTaxeTableAdapters.TA_TauxTaxe.FillByPays(TauxTaxeDataTable dataTable, String Pays) dans d:projetvisual c++ 2005projets c++cli est_adods_tauxtaxe.h:ligne 1247
   Ã Test_ADO.Form1.Sel_Pays_NewSel(Object sender, EventArgs e) dans d:projetvisual c++ 2005projets c++cli est_adoform1.h:ligne 1887
   Ã System.Windows.Forms.RadioButton.OnCheckedChanged(EventArgs e)
   Ã System.Windows.Forms.RadioButton.set_Checked(Boolean value)
   Ã Test_ADO.Form1.Init_Form1() dans d:projetvisual c++ 2005projets c++cli est_adoform1.h:ligne 1480
   Ã Test_ADO.Form1.Form1_Load(Object sender, EventArgs e) dans d:projetvisual c++ 2005projets c++cli est_adoform1.h:ligne 1446
   Ã System.Windows.Forms.Form.OnLoad(EventArgs e)
   Ã System.Windows.Forms.Form.OnCreateControl()
   Ã System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   Ã System.Windows.Forms.Control.CreateControl()
   Ã System.Windows.Forms.Control.WmShowWindow(Message& m)
   Ã System.Windows.Forms.Control.WndProc(Message& m)
   Ã System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   Ã System.Windows.Forms.ContainerControl.WndProc(Message& m)
   Ã System.Windows.Forms.Form.WmShowWindow(Message& m)
   Ã System.Windows.Forms.Form.WndProc(Message& m)
   Ã System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   Ã System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   Ã System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Finally, SQL Statement for "TA_TauxTaxe::FillByPays" is the following:

SELECT        Pays, Province_Etat, Taxe1_Appl, Taxe1_Dsc, Taxe1_Taux, Taxe2_Appl, Taxe2_Dsc, Taxe2_Taux
FROM            TauxTaxe
WHERE        (Pays = @Pays)

In debug mode, I double-checked and could verify that @Pays didn't have any null value but a valid string value at time "Fill" routine was invoked.  Any clue?

View 3 Replies View Related

SQL Server 2008 :: Populate One Dataset In SSRS Based On Results From Another Dataset Within Same Project?

May 26, 2015

I have a report with multiple datasets, the first of which pulls in data based on user entered parameters (sales date range and property use codes). Dataset1 pulls property id's and other sales data from a table (2014_COST) based on the user's parameters. I have set up another table (AUDITS) that I would like to use in dataset6. This table has 3 columns (Property ID's, Sales Price and Sales Date). I would like for dataset6 to pull the Property ID's that are NOT contained in the results from dataset1. In other words, I'd like the results of dataset6 to show me the property id's that are contained in the AUDITS table but which are not being pulled into dataset1. Both tables are in the same database.

View 0 Replies View Related

Integration Services :: Perform Lookup On Large Dataset Based On A Small Dataset

Oct 1, 2015

I have a small number of rows in a dataset, Table 1.  There is a CLOB on a large dataset, Table 2.  They join on a PK.  I would like to retrieve this CLOB and add it to the data flow for Table1.  In short I want to emulate the following:

Table 1:  Small table without CLOB, 10 rows. 
Table 2: Large table with CLOB, 10,000,000 rows

select CLOB
from table2
where pk = (select pk from table1)

I want this to return the CLOBs for the small number of rows in Table 1.  The PK is indexed obviously so it should be a fast look up.

Table 1 and Table 2 live on different Oracle databases.  How do I perform this operation efficiently in SSIS?  It seems the Lookup and Merge Join wont do this.

View 2 Replies View Related

Reporting Services :: Populate One Dataset In SSRS Based On Results From Another Dataset Within Same Project?

May 27, 2015

I have a report with multiple datasets, the first of which pulls in data based on user entered parameters (sales date range and property use codes). Dataset1 pulls property id's and other sales data from a table (2014_COST) based on the user's parameters.

I have set up another table (AUDITS) that I would like to use in dataset6. This table has 3 columns (Property ID's, Sales Price and Sales Date). I would like for dataset6 to pull the Property ID's that are NOT contained in the results from dataset1. In other words, I'd like the results of dataset6 to show me the property id's that are contained in the AUDITS table but which are not being pulled into dataset1. Both tables are in the same database.

View 3 Replies View Related

Typed Dataset Schema Throwing Error

Apr 8, 2006

Hello,I'm using a typed dataset to access my database (SQL Express); I have a table that returns data, which two fields are null; I'm getting this error:{"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."}There are no foreign-key or unique key constraints, so it has to be a non-null issue; I changed the two fields in the table to have a null value of Empty instead of Throw Exception, but I don't understand what the problem is coming from...  I'm at a loss.Thanks.

View 2 Replies View Related

Reporting Services :: Error With Shared Dataset

Apr 23, 2015

I've just recently tried to upload a report to my organisations local SharePoint site (2010)...it has reporting servers functionality and works fine otherwise. I have site ownership but have no control over the SharePoint Farm etc.

The trouble i've ran into is that the new report i've created is being pulled from a third party company's own server, with the shared dataset on their reporting server...it works fine when i run it on my computer or on their software system but it needs to be on the SharePoint site as well. For some bizzare reason it's against their policy to connect direcrtly to the database meaning i can't just create a data-source to sort this mess out.

The report server cannot process the report. The reference for the shared dataset 'DischargePerformancefull' is not valid. (rsInvalidDataSetReference) 

I've tried uploading the dataset into the same sharepoint library as the report but it just comes up with XML errors when i try to open it and it won't let me point the dataset to it from the SharePoint options.

View 2 Replies View Related

Dataset Not Filled If Sql-query Generates Error

Jun 13, 2007

Hi,

I've a dataset which is filled using a stored procedure in either MSSQL2005 or 2000.

The procedure may return sql-errors (f.ex 208 if a table is not found), but the procedure will anyway return data which shall populate the dataset, independent on 208 errors.

The procedure works fine if running it from f.ex. SqlMgtStudio, and the dataset is filled if the procedure triggers no errors.

However, if the procedure triggers an error like 208, then I get an exception in the application and the dataset is not populated with the data returned by the procedure.

Is there a way of telling the DataSet/SqlDataAdapter to fill the dataset even if the sql-code genererates som errors?

Regards, Guttorm

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved