Retrieving Data From Sqldataprovider W/out Presentation Control

Jun 27, 2006

Is there a way to retrieve a returned value from a stored procedure w/out binding do a data presentationi control?  I have the following sqldataprovider...

  <asp:SqlDataSource ID="SqlDataSource1" runat="server"
SelectCommand="f_GetUser"
ConnectionString="<%$ ConnectionStrings:MyServer %>"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:formparameter name="username" formfield="txtusername" />
<asp:formparameter name="password" formfield="txtpassword" />
</SelectParameters>
</asp:SqlDataSource>

 Do I have to make a gridview to get the value that is returned from this stored procedure?  The SP only returns one value (a count of records) and I want to set it to a variable.  Is there a way, similar to a recordset in ASP, that I can access that one value?

here is my stored procedure...

 CREATE PROCEDURE f_GetUser
@username varchar(50),
@password varchar(50)

AS
SELECT COUNT(*) AS numusers
FROM f_Users
WHERE username=@username AND password=@password

 I just want to retrieve "numusers" and use it in a conditional....

tia for your help

View 3 Replies


ADVERTISEMENT

Data Presentation At Each Level

Aug 8, 2007



I have a table with Columns as metric id, product name, product id, sales, amount.
The values of the column metric id will be 101, 102, 103 etc..

I need to create a report, in which I need to show up data as below:

1 series -------
metric 101:
product name, product id, sales, amount

metric 102:
product name, product id, sales, amount


metric 103:
product name, product id, sales, amount

2 series--------
metric 201:
product name, product id, sales, amount

metric 202:
product name, product id, sales, amount


metric 303:
product name, product id, sales, amount

Please let me know, how I can show the rows of that table grouped for each metric id.

View 1 Replies View Related

Transact SQL :: Present Data In Presentation Layer After Removing Temp Table?

May 21, 2015

Inside of stored procedure you have the code

create table #datatable (id int,
name varchar(100),
email varchar(10),
phone varchar(10),
cellphone varchar(10),
none varchar(10)
);
insert into #datatable
exec ('select *
from datatable
where id = 1')
select * from #datatable

I still want to retrieve the data and present it in the software's presentation layer but I still want to remove the temp table in order to reduce performance issue etc.

If I paste the code DROP

TABLE #datatable after
insert into #datatable
exec ('select *
from datatable
where id = 1')

Does it gonna work to present the data in the presentation layer after removing the temp table?

The goal is to retrieve the data from a stored procedure and present it in the software's presentation layer and I still need to remove the temptable after using it because I will use the SP many time in production phase.

[URL]

View 5 Replies View Related

Reporting Services :: Report Builder - Set Parameter To Include Or Exclude Columns From Data Presentation

Oct 2, 2015

Based on a table like below I have created a report so that I can compare number of items in the main warehouse (LOCATION1) and the outlets (LOCATION2 and LOCATION3).

___________________________________
| ID | PRODUCT_INDEX | LOCATION   | VALUE |
___________________________________
| 1  | INDEX1             | LOCATION1 | 1         |
___________________________________
| 2  | INDEX1             | LOCATION2 | 1         |
___________________________________
| 3  | INDEX1             | LOCATION3 | 0         |
___________________________________
| 4  | INDEX2             | LOCATION1 | 0         |
___________________________________
| 5  | INDEX2             | LOCATION2 | 0         |
___________________________________
| 6  | INDEX2             | LOCATION3 | 1         |
___________________________________
| 7  | INDEX3             | LOCATION1 | 1         |
___________________________________
| 8  | INDEX3             | LOCATION2 | 0         |
___________________________________
| 9  | INDEX3             | LOCATION3 | 1         |
___________________________________

The way I present data in my Report is as such. I want to show items that are available in the warehouse that should be moved to the outlets.

select 
 a.PRODUCT_INDEX
, a.LOCATION1(VALUE)
, b.LOCATION2(VALUE)
, c.LOCATION3(VALUE)  
from 

[Code] .....

__________________________________________________________________
| PRODUCT_INDEX | LOCATION1 (VALUE) | LOCATION2 (VALUE) | LOCATION3 (VALUE)|
__________________________________________________________________
| INDEX1               | 0                              | 1                               | 0                             |
__________________________________________________________________
| INDEX2               | 1                              | 0                               | 1                             |
__________________________________________________________________
| INDEX3               | 1                              | 0                               | 1                             |
__________________________________________________________________

I have added some parameters in my report to filter out products that are not available in warehouse (LOCATION1) and this works great.

select * from VIEW where 'LOCATION1(VALUE)' > 0 and ('LOCATION2(VALUE)' = 0 or 'LOCATION3(VALUE)' = 0)

__________________________________________________________________
| PRODUCT_INDEX | LOCATION1 (VALUE) | LOCATION2 (VALUE) | LOCATION3 (VALUE)|
__________________________________________________________________
| INDEX1               | 1                              | 1                               | 0                             |
__________________________________________________________________
| INDEX3               | 1                              | 0                               | 1                             |
__________________________________________________________________

Now the issue starts when I add a parameter to my report for user to choose which outlets (LOCATIONs) he wants in the equation. I know how to make a column disappear based on parameter value but how to take it out of equation? At the moment when user selects only LOCATION2 and not LOCATION3 then data is not filtered correctly:

__________________________________________________
| JOIN_ON_VALUES | LOCATION1 (VALUE) | LOCATION2 (VALUE) |
__________________________________________________
| INDEX1                 | 1                              | 1          |
__________________________________________________
| INDEX3                 | 1                              | 0          |
__________________________________________________

Ideally I would like a user to select random outlets (warehouse would be static on the report) and compare one or multiple and only show records that are 0 in the outlets.

View 2 Replies View Related

DNN DAL SqlDataProvider Passing NULL To SQL Stored Procedure

Jun 1, 2006

Hello,I'm trying to pass a null object to a stored procedure to update a SQL Table boolean field with a null value.  My SQL Table boolean column allows nulls.I'm using an InfoObject which has several properties all corresponding to fields in the SQL Table.  One of those fields is a boolean.  I create an instance of the InfoObject in my code and assigns values to the various properties.  The boolean property in question (call it InfoOjbect.BooleanProperty) is not assigned anything.  I then call my StoredProcedure passing the InfoObject to it (using the DotNetNuke DAL architecture) and the final result is the Table's boolean column is populated with a 0 and not a NULL.  If I explicitly define the InfoObject.BooleanProperty = null.nullboolean before passing it to the Stored Procedure, the same thing happens.  How do I pass a null to the SQL database for a boolean field?  I've tried making InfoObject.BooleanProperty = dbnull.value but it won't let me do this saying "dbnull cannot be converted to a boolean."  Do I have to explicitly create my InfoObject properties to allow for a null to be assigned to it?Any help would be greatly appreciated.  I'm using the DotNetNuke DAL architecture passing my InfoObject through a dataprovider to the sqldataprovider which calls the SQL Stored Procedure to add the new record to the Table.Thanks in advance for any help.

View 2 Replies View Related

My SSIS Presentation.

Jun 2, 2006

I was demonstrating some of SSIS's capabilities to our Software Development Manager and VP of IS. (We are deciding which ETL tool to use for our DW project. So goes this project goes the house).They liked what they saw and were crazy over Fuzzy lookup but commented that SSIS seems very much oriented toward the programmer side of the house. It was, maybe, not the best tool for the Business analysts who are working closely with us on this project.

Any comments on their comment?

I wonder if SSIS "data source views" (which I haven't looked at at all) address their concerns?



Barkingdog

View 5 Replies View Related

Database Structure And Presentation

May 14, 2008

I'm trying to design a site for parent conference scheduling.
Usually we have a couple of days appointment time, for example 5/8/2008, and 5/9/2008. and the time usally start at 7:00 and ends at 9:00. one appointment time lasts about 20 minutes.
I would put a page something like this, after parent or student login, 1. they are asked to choose a date, 2.after the date is chosen, show available teacher names, 3, after the teachers are selected, for each teacher, it will show a list of radio buttons for parents to select the time period open, For example: 
 teacher: John smith. time: 7:00; radio button        7:20 radio button        7:40 Booked...............        8:40  radio button       
4, the student choose the available time, and then enter student name, then submit.
I would like to know how to setup the database table and present to the users. Currently for this scheduling part I have tables like teachertable, scheduling table, Appointment table.
Teacher table: teacherID, name, email, course,Scheduling table: appointD, TeacherID, room, appt date
I think I will prepopulate the two tabels before conference time.
 and after user submit the selection, insert into Appointment table the other fields like scheduling ID, appoint time, and studentname.
The things confuse me, is how can I deal with the appointment time fields, shall I add another table for appt time? should this field be prepopulatd to the table and pull from the table for student to select or something else?
HOw can I do with this: if a teacher not available after 8, how can I excluded the time period for the teacher?
 Thanks
 
 

View 1 Replies View Related

Table Design For Presentation

Mar 16, 2004

I need to report on what users have what permissions. This is the way we have it stored currently. There must be a better way to store or retrieve this info. in a warehouse. Ideas?

Thanks,

-Kevin

USER readwriteexecutechange UIcreate proc.
joexxx
billxx
bobxxx

View 6 Replies View Related

Values Of Two Columns In Two Different Tables--presentation Using Select

Mar 14, 2006

Values of two columns in two different tables--presentation usingselectHi Everyone,i have two tables in the database . One is called address tableand one is adressPhone Table. Below is the sample of those two tablesAddresscol1 col2 col3X 12 13y 15 19z 18 10create table address(col1 varchar(20),col2 int, col3 int)insert into address values ('x',12,13)insert into address values ('y',15,19)insert into address values ('z',18,10)AddressPhoneCol4 Col5 Col613 213-455-9876 113 415-564-6546 213 543-987-5677 319 678-555-2222 1create table addressphone(col4 int, col5 varchar(50),col6 int)insert into addressphone values(13,'213-455-9876',1)insert into addressphone values(13,'415-564-6546',2)insert into addressphone values(13,'543-987-5677',3)insert into addressphone values(19,'678-555-2222',1)I have to display something like thisx 12 13 213-455-9876 415-564-6546 543-987-5677y 15 19 678-555-2222 NULL NULLSo there is one to many relationship between address andaddressPhone table where address.col3 = addressphone.col4I don't know how to write the query to get the phone numbers thathas he same id in the same row like I displyed above.I did something like this, but this is not workingselect col1,col2,col3, (select col5 from addressPhone where col6=1),(select col5 from addressPhone where col6=2), (select col5 fromaddressPhone where col6=3),from address table inner join addressPhoneon address.col3=addressphone.col4above is not working because it is complaining that a subquerycannot return multiple results. Col6 in the addressphone table isthe phone type ike business phone,mobile phone or home phone. It is possible that there are two phonenumbers for business phone.Please let me know how can I write this query.Any help will be greatly appreciated.Thanks

View 4 Replies View Related

SQL Server 2005 Reporting Services Presentation

Feb 13, 2007

Hi, I'm looking for SQL Server 2005 Reporting Services presentation.

Anybody help, please.

Thank you.

View 1 Replies View Related

Retrieving Data

Jun 15, 2004

Hi

I've got a module that contains the following function.
Imports System.Data.SqlClient

Module SQL_Sprocs
Function ListUsers()

Dim conn As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("DBConn"))


Dim cmd As SqlCommand = New SqlCommand("list_users", conn)
cmd.CommandType = CommandType.StoredProcedure
conn.Open()

Dim dr As SqlDataReader

dr = cmd.ExecuteReader

ListUsers = dr

dr.Close()
conn.Close()

End Function
End Module


I then want to call this function from my webform. So I'm using the following

Dim dr As SqlClient.SqlDataReader

dr = Timetracker.SQLProcs.ListUsers()

Do While dr.Read
Label1.Text &= dr("first_name") & " " & dr("last_name") & ", "
Loop

dr.Close()


But it's not working. I want to have a module that contains all my sprocs and be able to call them from the individual webpages.

What am I doing wrong?

Lbob

View 3 Replies View Related

Retrieving Data

Dec 21, 2006

Faculty member writes:

"I meant to delete just one assignment, doing which was giving me difficulty.

I deleted a whole category by accident which had most of my daily grades in it for a course with quite a few of them. I was negligent in backing them up, so I cannot restore them. I have an XLS file from the midterm, but am missing about 6 grades after that.

Is there any way to recover the grades I had in the deleted category. It has been a couple of days since I entered any new grades. HELP!"

My current backup strategy is to do a full backup 5 pm, differentials every 2 hours, logs every 30 min, all so they arenot simultaneous. Backing these all to same backup device via three different jobs.

Then the server is backed up to tape shortly after the 5 pm full backup.

Obviously, I can't restore from the backup for this situation because it would hurt other data.

But - is there a way I can take last night's backup from tape and restore it to a different database than our production database? (Such a database doesn't at this time exist. Would I detach, copy over the files, and then reattach on prod and attach on the devl side, and then restore from the backup device to the devl copy?)

I've never had to perform this kind of rescue and am wondering if my backup strategy is flawed since it isn't immediately evident how I can easily do this.

I needed a similar thing from our Oracle DBA yesterday, and he went to tape, copied out a table and put it on the Oracle database under a different owner, and I easily fixed the few records that I had botched.

That's exactly what I need to do now with MS SQL 2000.

As the faculty dude said, "HELP!"

And Thanks.

View 2 Replies View Related

Retrieving Data

Oct 26, 2005

Hi,

I was hoping someone would be able to help me, I trying to go through several databases, 111 to be exact, and get the data out of a particular table which is present in all the databases on the same server.

I know how to get the names of the databases from the INFORMATION_SCHEMA, but how can use the name for it to cycle through all the databases and get data out of the one particular table.

View 5 Replies View Related

Retrieving Data From SQL

Apr 23, 2007

Hi, I need some help. I have this query where i need to pull up students that have more than or equal to 3 absences in a row. Now I am getting all those students that are absent but not in a row. But i was wondering if there is a way to tell if a student was absent three days in a row . There is a date field that is being used to identify the day of the class and a status field that identifies if the student was absent or present. Please help someone.

Birju

View 3 Replies View Related

Retrieving Data From .MDF???

Jun 26, 2006

Dear fellows,

Up to the moment I've got enough knowledge for read data stored into .LDF files by dbcc log and so on. It's very useful and interesting. Now, I wonder how to retrieve the same information but on MDF files.

At first, I want to make sure that is not possible by mean of traditional methods (dbcc or something like that) I suppose so but I'd like to hear opinions regarding that.

Thanks in advance for any idea, though or further information.

View 4 Replies View Related

Retrieving Data From SQL Table

Feb 5, 2008

 this is a simple problem but it's just driving me mad as it's not reading from my dB. basically, I've have reviews stored in my dB and want to display them in a textbox by clicking on a button called btnReviews. I think the problem might be that there is too much text stored per row of the table (as it is a review), but I have the datatype set as text in sql. here's the simple un-errorred code I have behind the button. any ideas where I went wrong. i've a feeling it's something small but it's just taken too long to figure out.protected void btnReviews_Click(object sender, EventArgs e)    {        String strConn = ConfigurationManager.ConnectionStrings["conLocalDatabase"].ConnectionString;        SqlConnection dbConnection = new SqlConnection(strConn);        SqlCommand dbCommand = new SqlCommand("Select [ReviewC] From [Review])", dbConnection);          dbCommand.Parameters.AddWithValue("Review", txtReviewView.Text);        try        {            dbConnection.Open();            dbCommand.ExecuteNonQuery();        }        catch (SqlException ex)        {            Console.WriteLine(ex.ToString());        }        finally        {            if (dbConnection != null)            {                dbConnection.Close();            }        }            }

View 6 Replies View Related

Retrieving Data From More Than One Table

Apr 28, 2008

Hi
  I ve a datagrid . And Two Database table in sqlServer2005.  The name of the tables are 'Property' and 'userid'.
  My datagrid wants to retrive all records from Property table and one record from userid table. The Property table contains Propertycode, lastdate , departmentname.   
  The userid table contains so many record along with 'id'  record  which my datagrid wants to retrieve.
pl tel me how 2 write code for that? 

View 1 Replies View Related

Retrieving Sorted Data

Jul 18, 2005

I have four tables that need to be loaded into an ASP.NET application. They need to be loaded together into one result set and sorted. Is it possible to load four tables together and sort them using an SQL statement?

To clarify, say I have the following data:

Table1: Anglesey, Cardiff, Ceredigion
Table2: London, Dorset, Lancashire
Table3: Antrim, Armagh
Table4: Glasgow, Berwick, Edinburgh

I'd want the data retrieved from all four tables and sorted so that the data retrieved would be:

Anglesey, Antrim, Armagh, Berwick, Cardiff, Ceredigion, Dorset, Edinburgh, Glasgow, Lancashire, London

I am aware of and am using the SELECT ... ORDER BY feature of MSSQL in my present ASP.NET application to retrieve from single database tables. I'm using merged datasets and a sort method to solve the above problem at the moment.

View 9 Replies View Related

Using COALESCE And Retrieving Data

May 16, 2012

I'm preparing a report that will display provider number, provider name, and a single field that will show all the counties that specific provider serves. I realize from researching the coalesce posts that this can be done. However, when I try to retrieve data in the same select statement as my coalesce, I get the error: "A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations."The listing of the counties must be specific to the provider, so my original code was:

DECLARE @Counties varchar(1000)
SET @Counties = ''
SELECT a.PROV_ID, a.PROV_NAME,
@Counties=coalesce(@Counties,'') + b.COUNTY + ','
from ECBH.dbo.tbl_PROVIDERS a inner join ECBH.dbo.tbl_Provider_Serv_Regions c
on a.PROV_ID = c.PROV_ID
inner join ECBH.dbo.tbl_Regions b
on b.REGION_ID = c.REGION_ID
where c.PROV_ID = a.PROV_ID
and a.MASTER = 1

I thought about creating a table to hold the coalesced values (need to coalesce two other fields as well), but wouldn't an insert to a table fail for the same reason?The counties table does not relate to the provider table, but does relate to a provider_county table (which in turn relates to the provider table).

View 1 Replies View Related

Need Help With Retrieving Deleted Data

Mar 4, 2008

Hello,

Thank you for reading this. I am faced with a problem where there is no storage of deleted or updated information in an OLTP DB. I am mostly concerned about retrieving the deleted data from a table when an update occurs so as to make the deleted data show as an error. Is there a way to retrieve these kind of data from a DB, if so how? Can these data be retrieved by dates? Also how much time do you have before the data can no longer be retrieved? Assuming that the data can be retrieved.

I know the good stuff about datawarehousing but unfortunately we have no DW. Any help will be greatly appreciated.

View 1 Replies View Related

Retrieving A Portion Of PK Data

Mar 27, 2008

I want to extract a particular portion of primary key field data.For example- suppose there are fifty data in PK field starting from 1...50.Now I want only to extract data from 25 to 50.It is bcos I want to retrieve only the new data that is inserted after a specified time.For example-today there is data starting from 1 to 25 which I have retrieved and saved elsewhere.By tomorrow there will be new data starting from 26 to 50 or more.Now I just want to extract this additional data from the database so that I dont need to extract all data again.Could anybody pls tell me how to do this.How can I do it using common SQL bcos I have to make a program for it.

View 1 Replies View Related

Retrieving A Portion Of PK Data

Mar 27, 2008

I want to extract a particular portion of primary key field data.For example- suppose there are fifty data in PK field starting from 1...50.Now I want only to extract data from 25 to 50.It is bcos I want to retrieve only the new data that is inserted after a specified time.For example-today there is data starting from 1 to 25 which I have retrieved and saved elsewhere.By tomorrow there will be new data starting from 26 to 50 or more.Now I just want to extract this additional data from the database so that I dont need to extract all data again.Could anybody pls tell me how to do this.How can I do it using common SQL bcos I have to make a program for it.

View 1 Replies View Related

Retrieving Data From SQL2000

Mar 15, 2007

I am trying to retrieve data that has been inserted into the database but only half the text is being displayed.
The field is varchar(8000)

In the Enterprise Manager I can view the data, then I copy and paste it into MS Word and everything is there.
851 Characters with spaces.

However, when I enter the SQL code into SQL Query Analyzer only half the text shows, about 257 characters are displayed with spaces.

When I display the information on the webpage only half the text is displayed (running IIS/PHP 5)

I don't know why this is doing this and not sure what I can do to display the full text.

Please help.

View 4 Replies View Related

Retrieving Data From Database...

Jun 4, 2006

Hi all,

I am working on a project on PocketPC in which it is required to reteive data from database. I have created database on simulator as .sdf file. I want to retreive data from eVC++ code. How i can do so?

thanx

View 1 Replies View Related

Retrieving SQL Data From VC++(using VC++ 2005)

Oct 23, 2006

Hi to all,I made a database using SQL Server 2005 and now I want to interact with that database through VC++ 2005. Is that possible?? If so, how can I do it?

Thanks in advance!!!

View 1 Replies View Related

Help With Retrieving String Data

Aug 30, 2007

Hello,

I am trying to retrieve only the first few characters (12 to be precise) from this string that is coming in from FoxPro to SQL Server 2005 and I am coding in C#. I have tried these methods (after reading it in a book, as I am new to this) but it still gives me an error saying that the field cannot exceed 12 characters.

autoClaimSalvage.Phone = "Select LEFT ('" + (string)(drInputDataSource["OWNPHN"]) + "',12) From '" + entityManager.TargetTable + "'";
autoClaimSalvage.Phone = "Select LTRIM(RTRIM(OWNPHN)) From '" + entityManager.TargetTable + "'";
autoClaimSalvage.Phone = "Select LTRIM(RTRIM('" + ((string)(drInputDataSource["OWNPHN"])) + "'))" + entityManager.TargetTable + "'";


Please let me know what i am doing wrong and if anyone has a sample code or if you can point me in the right direction, I will appreciate it.

Thanks for your help in advance.

View 4 Replies View Related

Retrieving UDT Data In Non .NET Languages. ?

Jan 9, 2007

I have been thinking of using SQL server 2005 as i would like the flexibility i get through UDT. Retrieving the UDT data in managed could is ok but i would like to retrieve it in non .NET languages too.

For example lets say i create a UDT "Point". I insert data in a table that has some columns of type point.

Now is there a way i can get the data of the type point in a point object in non .NET languages like perl, python...

View 1 Replies View Related

Problem Retrieving Data From SQL CE

Feb 21, 2008

Hi,

I am using Visual Studio 2008 with .NET 3.5 Visual Basic. I'm having a problem retrieving data from my SQL CE database.
I have a function that imports a file, parses it and writes the contents to a database. When I then query the database from my code, the data I have just written doesnt seem to be there. Even when i close and re-run the program. Only when I first view the table contents through Visual Studio then re-run the program does the data show up.

The things I know are. When I insert data there is no problem. I can view the data through visual studio server explorer. only when I view data through the server explorer can my code retrieve it.

Could this be something to do with caching? Any help would be appreciated. The (stripped down) code I use to insert data is below

kevin


Dim rowsAffected = 0

Dim connection As New SqlServerCe.SqlCeConnection(connectionstring)
Dim transaction As SqlCeTransaction

' command objects for inserting a ContactList and retrieving its last identity
Dim cmdInsertContactList As New SqlServerCe.SqlCeCommand("INSERT INTO ContactLists (Name, FolderID) VALUES (@Name,@FolderID)")
cmdInsertContactList.Parameters.Add("@Name", SqlDbType.NVarChar)
cmdInsertContactList.Parameters.Add("@FolderID", SqlDbType.NVarChar)

Try

connection.Open()
transaction = connection.BeginTransaction()

cmdInsertContactList.Connection = connection
cmdInsertContactList.Transaction = transaction

' insert a new list
cmdInsertContactList.Parameters("@Name").Value = list.Name
cmdInsertContactList.Parameters("@FolderID").Value = folder.ID
rowsAffected += CInt(cmdInsertContactList.ExecuteScalar())


transaction.Commit()

Finally
connection.Close()
End Try

View 2 Replies View Related

Column Order/presentation In Virtual Table (result Set From Viewor UDF)

Sep 1, 2006

I was just messing around with some ad hoc views and table returningUDFs today so I could look at and print out data from a small tableand noticed something strange.If I stick my select statement into a View the columns are returned inthe order I specify in the SELECT, but if the same statement is in a UDF(so I can specify a parameter), the columns are not returned in theorder specified in statement.I know that relations don't have a specified column order, but it was myunderstanding that a SELECT statement could be used to define how youwant your data presented. Views seem to respect the order specified inthe SELECT, but functions don't.What am I missing? Is there some way to force the order of the columnsreturned from a SELECT?View:CREATE VIEW dbo.View1ASSELECT Ident, Text, Type, ParentStmt, ForStmt, IfStmt, ChildStmt,ThenStmt, ElseStmt, NextStmtFROM dbo.tblStmtWHERE (Ident LIKE '4.2.%')Column order from this view:Ident, Text, Type, ParentStmt, ForStmt, IfStmt, ChildStmt, ThenStmt,ElseStmt, NextStmtFunction:ALTER FUNCTION dbo.Function1(@SearchPrm varchar(255))RETURNS TABLEASRETURN ( SELECT Ident, Text, Type, ParentStmt, ForStmt, IfStmt,ChildStmt, ThenStmt, ElseStmt, NextStmtFROM dbo.tblStmtWHERE (Ident LIKE @SearchPrm) )Column order from this function:Type, Text, ElseStmt, NextStmt, IfStmt, ChildStmt, ThenStmt, Ident,ParentStmt, ForStmtTable:(I know that this table isn't entirely normalized, but it serves mypurposes to have a matrix instead of a fully normalized relation):CREATE TABLE dbo.tblStmt (StmtID INT IDENTITY(1,1) CONSTRAINT PK_Stmt PRIMARY KEY,Ident VARCHAR(255),Text TEXT,ErrorText TEXT,Type INT,ParentStmt VARCHAR(255),ChildStmt VARCHAR(255),IfStmt VARCHAR(255),ForStmt VARCHAR(255),ThenStmt VARCHAR(255),ElseStmt VARCHAR(255),NextStmt VARCHAR(255),FullName VARCHAR(255),LocalName VARCHAR(255),Method INT)INSERT INTO tblStmt Ident, Text, Type, ParentStmt, NextStmtVALUES('4.2.1', 'LineNumberOfResp := EMPTY' 64, '4.2', '4.2.2')INSERT INTO tblStmt Ident, Text, Type, ParentStmt, ChildStmt, ForStmt,NextStmtVALUES('4.2.2', 'FOR K:= 1 TO 2', 128, '4.2', '4.2.3','4.2.7')INSERT INTO tblStmt Ident, Text, Type ParentStmt, ChildStmt, ForStmt,NextStmtVALUES('4.2.3', 'Person[K].KEEP', 16, '4.2', '4.2.3.1', '4.2.2', '4.2.4')INSERT INTO tblStmt Ident, Text, Type, ParentStmt, NextStmtVALUES('4.2.3.1' 'AuxInterviewerName := DOSENV', 64, '4.2.3', '4.2.3.2')

View 3 Replies View Related

Retrieving Data Using A Stored Procedure

Mar 31, 2007

I have created the following stored procedure and tried to retrieve it's output value in C#, however I am getting exceptions. Can anyone tell me what I am doing wrong? Thanks!  1 ALTER PROCEDURE [dbo].[GetCustomerById]
2
3 @CustId NCHAR(5),
4 @CustomerName NVARCHAR(50) OUTPUT
5
6 AS
7 BEGIN
8
9 SELECT @CustomerName = ContactName
10 FROM Customers
11 WHERE CustomerId = @CustId
12
13 END
14
15 RETURN
16
17
18
19
20
21
22 SqlConnection conn = GetConnection(); //retrieves a new SqlConnection
23 SqlCommand cmd = new SqlCommand();
24 cmd.Connection = conn;
25 cmd.CommandType = CommandType.StoredProcedure;
26 cmd.CommandText = "GetCustomerById";
27
28 SqlParameter paramCustId = new SqlParameter();
29 paramCustId.ParameterName = "@CustId";
30 paramCustId.SqlDbType = SqlDbType.NChar;
31 paramCustId.Direction = ParameterDirection.Input;
32 paramCustId.Value = "ALFKI";
33
34 SqlParameter paramCustomerName = new SqlParameter();
35 paramCustomerName.ParameterName = "@CustomerName";
36 paramCustomerName.SqlDbType = SqlDbType.NVarChar;
37 paramCustomerName.Direction = ParameterDirection.Output;
38
39 cmd.Parameters.Add(paramReturn);
40 cmd.Parameters.Add(paramCustId);
41 cmd.Parameters.Add(paramCustomerName);
42
43 conn.Open();
44 SqlDataReader reader = cmd.ExecuteReader();
45
46 string custName = cmd.Parameters["@CustomerName"].Value.ToString();
  

View 6 Replies View Related

Retrieving Data From An Attached Mdf File

Apr 13, 2007

I attach my SQL Server Express data file to my host. I would like to copy all of my member information back to my local computer. How can I do this? My host won't allow my to physically copy the data file over.  My host is discountasp.net.   Thanks,Jeff

View 1 Replies View Related

Data Retrieving Or Querying Problem

May 10, 2007

Hi, I am using visual web developer 2005 express edition and Microsoft SQL 2005 to develop a fast-food ordering website and I am having trouble in retrieving data from a database table into a form. Can some one please teach me the way to write the syntax for retrieving or selecting a inserted value from the database? I have only know the syntax to insert data value from a form which is something like this:
'Create a New Connection to our daabase
Dim test As SqlDataSource = New SqlDataSource()
test.ConnectionString = ConfigurationManager.ConnectionStrings("Connectionstring1").ToString
'This is the SQL Insert Command
test.InsertCommand = "Insert into Customer([Initial],[Correspondent_Name],[Correspondent_No],[Payment_Type]) VALUES (@Initial,@Correspondent_Name,@Correspondent_No,@Payment_Type)"
'Each of this insert a value into the appropriate command
test.InsertParameters.Add("Initial", DropDownList4.SelectedValue) 'This is the selected "Initial" DropDownList value
test.InsertParameters.Add("Correspondent_Name", TextBox10.Text) 'This is the Correspondent_Name value
test.InsertParameters.Add("Correspondent_No", TextBox3.Text) 'This is correspondent_no value
test.InsertParameters.Add("Payment_Type", "Pay upon delivery") 'This indicates that the payment is made with credit card
test.Insert()
 But I have no idea the syntax to retrieve a data. Please help me with this matter as it is important to me. Thanks in advance!
 
Regards,
Ivan
 
 

View 2 Replies View Related

Saving Data And Retrieving It From The Database

Sep 18, 2007

Heres my requirement from a financial analysis im doing...I have just calculated an industry averages on financial ratios...Now i wanna upload this industry average to the system...so that I can compare it to the individual companies' averages after calculating a particular company's average; meaning i wanna be able to call the industry average of a particular ratio (eg Current Ratio) after calculating a company's corresponding ratio...Is there a code fragment i can use for this ?? Thanks in advance...Adam 

View 1 Replies View Related







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