Ideal Way To Retrive Dataset.

Jul 12, 2004

This is DataSet retriving code from IBUYSPY Events Module.








public DataSet GetEvents(int moduleId) {





// Create Instance of Connection and Command Object


SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);


SqlDataAdapter myCommand = new SqlDataAdapter("GetEvents", myConnection);





// Mark the Command as a SPROC


myCommand.SelectCommand.CommandType = CommandType.StoredProcedure;





// Add Parameters to SPROC


SqlParameter parameterModuleId = new SqlParameter("@ModuleId", SqlDbType.Int, 4);


parameterModuleId.Value = moduleId;


myCommand.SelectCommand.Parameters.Add(parameterModuleId);





// Create and Fill the DataSet


DataSet myDataSet = new DataSet();


myCommand.Fill(myDataSet);





// Return the DataSet


return myDataSet;


}








My Question is





1) Is this ideal way to retrive data?


2) Will it return connection back to pool?

View 4 Replies


ADVERTISEMENT

New To This! How Do I Retrive Elements In My Query Instead Of The Discription Of The Dataset?

Oct 10, 2007

View 3 Replies View Related

Ideal Hardware Configuration

Mar 12, 2004

What is the ideal hardware configuration for SQL Server 2000? We have about 2 dozen databases - ranging in size from 500 MB up to 90 GB. All databases have very heavy traffic from multiple users on the same app. There are about 8 reads for every write, averaging about 8 million writes per 24-hour period.

Currently we have these databases split across 2 servers with 4 2.4 Ghz hyperthreaded processors and have 8 GB of RAM. The disks are 10,000 RPM SCSI, and are all in one very large physical disk array split into 2 logical drives per server. Logs and data for multiple databases are all sharing the same array.

Performance is becoming a pressing issue. Our Network administrator is 100% that the hardware configuration is not an issue, and I am 100% convinced it is at least a major part of the issue. Does anyone here feel that it may be the issue?

View 2 Replies View Related

Ideal Number Of Join

Nov 12, 2006

Hi

What should be the ideal number of joins that should be used in a query? In some books it says anything beyond 7 joins should be re-considered. Is this correct. We have application where the number of joins are more than 25 and in some cases it is beyond 50. I am looking for some guidelines as it will help to design the table in the best possible way. I am not looking for reporting type of queries; instead they are all the business logic.

thanks

Sanjay 

View 3 Replies View Related

Ideal Local For Data Directory

May 12, 2008

I am currently deploying a desktop application that uses SQL Express as a local data source. I load data from other sources into the local database and then use that data for my application. Currently I'm deploying the MDF file into a Data folder within my application folder. I'm finding that most of the users that will be using this application has only power user rights, not admin rights.

My question is this. Is using a data folder within my application folder the ideal place to store this data or is there other more benefitial places within the users computer that would help reduce rights and permissions issues? When users upgrade to Vista will this cause any problems that another location might help me avoid?

Appreaciate any opinions.

View 6 Replies View Related

Ideal Event Handling Technique

Apr 13, 2007

Hi All,

We have this SSIS package that serves a ETL role, but sometimes when the package crashes we wanted our support personnel to be aware of it, so we did implement an Event handler Package, executable is the package and Event Handler on taskFailed. The idea is if any of the Tasks fail, then trigger the event handler.

Now recently I found out while debugging the package, one of the DFT's failed, and the control went to the Event handler. But thenrest of the Task's are executing and the package finished successfully.

How do I ensure that if at all some Tasks fail, the control should invoke the task at the event handler and end the package run.

One more query, what is the ideal and best way of Event handling to be followed in case of ETL jobs ?

Thanks in Advance.

View 10 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

How Can I Use SQL Reporting Services To Get A Dynamic Dataset From Another Web Service As My Reports Dataset?

May 21, 2007

I found out the data I need for my SQL Report is already defined in a dynamic dataset on another web service. Is there a way to use web services to call another web service to get the dataset I need to generate a report? Examples would help if you have any, thanks for looking

View 2 Replies View Related

Listing Datasets In Report (dataset Name, Dataset's Commands)

Oct 12, 2007



Is there any way to display this information in the report?

Thanks

View 3 Replies View Related

How To Retrive The Value Of @DerivedFileName

Jul 26, 2007

SqlCommand sqlCommand = new SqlCommand(spName, Conn);
sqlCommand.CommandType = CommandType.StoredProcedure;sqlCommand.Parameters.Add("@XMLString", SqlDbType.Xml).Value = XMLstring;
sqlCommand.Parameters["@XMLString"].Direction = ParameterDirection.Input;sqlCommand.Parameters.Add("@DerivedFileName", SqlDbType.VarChar,50);
sqlCommand.Parameters["@DerivedFileName"].Direction = ParameterDirection.Output;
int test = sqlCommand.ExecuteNonQuery();

View 1 Replies View Related

Retrive Xml As Output

Apr 24, 2008

My execution fails .
Cannot we retrive xml from stored procedures.

CREATE PROCEDURE USP_XML_TEST (@no int ,@var xml output)
AS
BEGIN
SET NOCOUNT ON;
select @var = details_xml from student where student_id = @no
END
GO

View 1 Replies View Related

Can Not Retrive @@identity Value

Jul 20, 2005

I use select @@identity to return @@identity from my store procedure,but I could not retrive it from my Visual basic code, like variable=oRS.fields.item(0).value, it always says item can not be found....

View 3 Replies View Related

Retrive Xml As Output

Apr 24, 2008

My execution fails .
Cannot we retrive xml from stored procedures as output .

Blow is my code.


CREATE PROCEDURE USP_XML_TEST (@no int ,@var xml output)
AS
BEGIN
SET NOCOUNT ON;
select @var = details_xml from student where student_id = @no
END
GO

View 5 Replies View Related

How To Retrive Data

Dec 15, 2006



How to retrive data from EXCL file by using SSRS.(My data is not sql server)

View 1 Replies View Related

How To Retrive A Value Using A Query String?

Jul 7, 2006

Hello,I would like to keep some values as session variables while the user is loged in, but i am missing some part of how to implement it.This is what I have:<script runat="server">

Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs)

Dim conn As SqlConnection
Dim cmd As SqlCommand
Dim cmdString As String = "SELECT users.username, users.password, users.FirstName, users.LastName, users.CompanyId, Company.CompanyName, users.SecurityLvl FROM users LEFT OUTER JOIN Company ON users.CompanyId = Company.CompanyId WHERE (users.password = @Password) AND (users.username = @Username)"

conn = New SqlConnection("Data Source=GDB03SQL;Initial Catalog=GDBRemitance;Persist Security Info=True;User ID=remitance;Password=remitance")
cmd = New SqlCommand(cmdString, conn)
cmd.Parameters.Add("@Username", SqlDbType.VarChar, 50)
cmd.Parameters("@Username").Value = Me.Login1.UserName
cmd.Parameters.Add("@Password", SqlDbType.VarChar, 50)
cmd.Parameters("@Password").Value = Me.Login1.Password


conn.Open()
Dim myReader As SqlDataReader
myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
If myReader.Read() Then

FormsAuthentication.RedirectFromLoginPage(Me.Login1.UserName, False)
Else
'Response.Write("Invalid credentials")
End If
myReader.Close()

End Sub
</script> I would like to know how can I get now the "user.FirstName" and pass it to a session variable???how should I code it? thanks,

View 1 Replies View Related

How Do I Retrive SQL Count Value Programmatically?

Jan 10, 2007

Hi Guys, I have this SqlDataSource, that counts some records and sets it in "NotStartedBugs". How do I retrive "NotStartedBugs" programmatically?
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT (SELECT COUNT(*) AS Expr1 FROM tickets WHERE (TicketType = 'Bug') AND (TicketStatus = 'Not Started')) AS NotStartedBugs"></asp:SqlDataSource>

View 1 Replies View Related

How To Retrive A SP Table Inside A SP?

Feb 28, 2007

Hello, inside of my SP i want to execute another SP, something like:
EXEC [dbo].[Forum_DeleteBoard] @BoardID = @DelBoardID
this function Forum_DeleteBoard returs one row with 3 columns as a table, how do i get the first column of that table into a variable so i can check if it was ok or not(it returns just one row with 3 columns).
Columns it returns:QResult , Threads , Answers
SELECT @isok = QResult FROM EXEC [dbo].[Forum_DeleteBoard] @BoardID = @DelBoardID   ?
or how do you get it?
Patrick

View 1 Replies View Related

How To Store And Retrive .DOC File In Sql

May 28, 2007

Hi frds,
 
My question is how should i store a .DOC file in sql 2005 as image field and how to retrive the Doc stored in Image format
 
Thanks & regards
Sithender.s

View 3 Replies View Related

Retrive Images From SqlServer In ASP .NET

Jan 7, 2008

I have a table called Image1 and i have stored the image in SQL server 2005  with a feiled called picture
 
table name ---- Image1
field-- picture (data type image)
 please let me know the code step by step code how to Retrive Images from SqlServer in ASP .NET webpage, please help me ....

View 19 Replies View Related

Retrive A Record From Database

Jan 9, 2008

hai everybody!!!!
am developing one application in visual 2005..and sql server.
so how to write the coding for searching one record from a database table according to the id..and to display it

View 1 Replies View Related

How To Retrive A Record From A Database

Jan 9, 2008

hai everybody!!!!!
am working wirh visual 2005 and sql server()asp.net).....so i need the coding in VB for searching one record from a database table according to the id..and want to display it.....

View 2 Replies View Related

How To Retrive Rownumbers In Mssql2003

Mar 27, 2008

hi all,i want to print row numbers from the select command, how to retrive row numbers in mssql2003

View 1 Replies View Related

Help-how To Retrive Date From Sql To Array

Aug 28, 2004

i m new 4 asp.net

i retrive data from sql database.
now,
i want to put that retrived data into array.
how could i do this?

i am use vb.net

plz anyone give any idea.
it's urgent

thanks in advance.

View 1 Replies View Related

How I Can Store & Retrive Images

Aug 14, 2001

hi,

i would like to know how i can store and retrive images from SQL server.
I will be happy if i have been explained with some examples.

View 1 Replies View Related

Retrive Data From Two SQL Server

Apr 24, 2002

Hi,

Does anyone how to use SELECT statement data from two different SQL Server ?

Thanks in advance
Wilson

View 2 Replies View Related

How To Retrive Truncated Records

Oct 6, 2006

Hi
I have a table Test a execute this below query

truncate table Test

I want to retrive records of Test table .How can i do.

Ranjeet Kumar Singh

View 10 Replies View Related

How To Retrive 1st, Next, Previous & Last Record ?

Apr 20, 2007

Hi, I am new to using SQL. Currently, I'm using the following statemens to retrive a specific record from my MS Access DB via VB.net.

SELECT * FROM table_name WHERE Field_Name = Criteria

Can someone please tell me, after selecting this record, If I want to go to the FIRST, or NEXT or PREVIOUS of the record just retrived or the LAST record. Can someone please tell me how can write the SQL statment to achieve this ?

Regards

View 3 Replies View Related

How To Retrive Correct Data

Nov 26, 2007





Code Block
SELECT
tce.TimeCardID,
tce.TimeCardExpenseID,
tc.DateCreated,
e.LoginID,
e.FirstName + ' ' + e.LastName AS FullName,
tce.ExpenseAmount,
tce.ExpenseDescription,
op.ProjectName,
op.ProjectDescription,
ec.ExpenseCode
FROM OPS_TimeCards tc
JOIN OPS_Employees e
ON e.EmployeeID = tc.EmployeeID
JOIN OPS_TimeCardExpenses tce
ON tc.TimeCardID = tce.TimeCardID
Join OPS_Projects op
ON op.ProjectID = tce.ProjectID
Join OPS_ExpenseCodes ec
ON ec.ExpenseCodeID = tce.ExpenseCodeID
WHERE e.LoginID = 'jross'
ORDER BY tc.DateCreated DESC






this query returns me the correct data....but i need to tweak the query so it does not duplicate rows....My tce.TimeCardID is a PK in its table and so is TimeCardExpenseID...but the problem is U can have many TimeCardExpenseID's for one timecard so my results look like

TimeCardID TimeCardExpenseID
1 2
1 3
1 4


I want my query to return the "TimeCardID" but i just want that one ID to represent all the TimeCardExpenseID's...but i can not get it to work and have no clue....

so if i do Select * From TimeCardID = '1'

it should return

TimeCardExpenseID
2
3
4

Any help on how to get this done....

View 4 Replies View Related

Dataset.Tables.Count=0 Where There Are 2 Rows In The Dataset.

May 7, 2008

Hi,
I have a stored procedure attached below. It returns 2 rows in the SQL Management studio when I execute MyStorProc 0,28. But in my program which uses ADOHelper, it returns a dataset with tables.count=0.
if I comment out the line --If @Status = 0 then it returns the rows. Obviously it does not stop in
if @Status=0 even if I pass @status=0. What am I doing wrong?
Any help is appreciated.


ALTER PROCEDURE [dbo].[MyStorProc]

(

@Status smallint,

@RowCount int = NULL,

@FacilityId numeric(10,0) = NULL,

@QueueID numeric (10,0)= NULL,

@VendorId numeric(10, 0) = NULL

)

AS

SET NOCOUNT ON

SET CONCAT_NULL_YIELDS_NULL OFF



If @Status = 0

BEGIN

SELECT ......
END
If @Status = 1
BEGIN
SELECT......
END



View 4 Replies View Related

Retrive A Binary Field From Database

Nov 15, 2006

hi
I have used the following code (mostly created by MSDN) to retrive a binary field from SQL database. it works but I have extra space between characters. for example if I save a text file with "Hello world" text, after retriving I have it like "H e l l o  w o r l d". what is the problem??????
I am really looking forward your answers
private void retrive()
{
public void a()
{
SqlConnection connection = new SqlConnection("Some Connection string");
SqlCommand command = new SqlCommand("Select * from temp", connection);
// Writes the BLOB to a file
FileStream stream;
// Streams the BLOB to the FileStream object.
BinaryWriter writer;
// Size of the BLOB buffer.
int bufferSize = 50;
// The BLOB byte[] buffer to be filled by GetBytes.
byte[] outByte = new byte[bufferSize];
// The bytes returned from GetBytes.
long retval;
// The starting position in the BLOB output.
long startIndex = 0;
// Open the connection and read data into the DataReader.
connection.Open();
SqlDataReader reader = command.ExecuteReader(CommandBehavior.SequentialAccess);
while (reader.Read())
{
// Create a file to hold the output.
stream = new FileStream(
"C:\file.txt", FileMode.OpenOrCreate, FileAccess.Write);
writer = new BinaryWriter(stream);
// Reset the starting byte for the new BLOB.
startIndex = 0;
// Read bytes into outByte[] and retain the number of bytes returned.
retval = reader.GetBytes(0, startIndex, outByte, 0, bufferSize);
// Continue while there are bytes beyond the size of the buffer.
while (retval == bufferSize)
{
writer.Write(outByte);
writer.Flush();
// Reposition start index to end of last buffer and fill buffer.
startIndex += bufferSize;
retval = reader.GetBytes(0, startIndex, outByte, 0, bufferSize);
}
// Write the remaining buffer.
if (retval != 0)
writer.Write(outByte, 0, (int)retval - 1);
writer.Flush();
// Close the output file.
writer.Close();
stream.Close();
}
// Close the reader and the connection.
reader.Close();
connection.Close();
}
}

View 1 Replies View Related

How To Retrive Date(alone) From Datetime Field

Nov 16, 2006

hai
In my web application i want to bind data from sql 2005 to ultrawebgrid,  when i use 
 source code
dim cmdselect as sqlcommand
dim cmdstring as string
cmdstring="select name, datefieldname from tablename"
cmdselect=new sqlcommand(cmdstring,connectionstring)
connectionstring.open()
ultrawebgrid1.datasource=cmdselect.executenonquery()
ultrawebgrid1.databind()
connectionstring.close()
----- when i execute above coding i am geting date and time displayed there, but i want to display date alone
--my datefield datatype  is datetime
- i am using sql 2005,(vs2005-vb/asp.net)
please help me
thanks in advance

View 2 Replies View Related







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