How Do I Store The Results From A SqlDataSource?

Apr 24, 2007

I have a label on my page that shows a persons name, but in the database it is identified by a ID for indexing purposes.  When I do a UPDATE (users can change other info on the page...not the name though), I want to update by the ID, not the actual name.  Problem is, I don't have the ID (just the name) on the page, so I would have to do a lookup for the ID in the database.  Is there a another  way to do this?  When I select the persons name for display using the SqlDataSource, it's easy to select the ID too.  But how can I use this ID on the UPDATE?  I don't want to reinvent the wheel.

View 1 Replies


ADVERTISEMENT

Need To Cache Or Store These SqlDataSource Objects

May 2, 2008

I have the following:omegalove.comIf you go to the search portion u will notice that there are three dropdownlist that are populate using sqldatasource object.I do not want these two post back. Is there a way we can cache this so it is faster.I would like to learn. I appreciate any help. Please don't give me links. I much rather learn from someone who has hands on.Thank you
I will have to separate the code from the ui?---------------------------------------------------------------------
Country:<asp:Image ID="FlagImg" runat="server" Height="12px" Width="20px" />

<asp:DropDownList ID="ddlCountry" runat="server" DataSourceID="SqlDSCountry" DataTextField="Country"

DataValueField="CountryID" AutoPostBack="True" OnDataBound="ddlCountry_DataBound" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged">

</asp:DropDownList>

<asp:SqlDataSource ID="SqlDSCountry" runat="server" ConnectionString="<%$ ConnectionStrings:omegaloveConnectionString %>"

SelectCommand="SELECT [CountryID], [Country] FROM [CountryCodes] ORDER BY [Country]">

</asp:SqlDataSource>


----------------------------------------------------------
State/Province:<br />

<asp:DropDownList ID="ddlRegion" runat="server" AutoPostBack="True"

DataSourceID="SqlDSRegion" DataTextField="Region" DataValueField="RegionID" OnDataBound="ddlRegion_OnDataBound" OnSelectedIndexChanged="ddlRegion_SelectedIndexChanged">

</asp:DropDownList><asp:SqlDataSource ID="SqlDSRegion" runat="server" ConnectionString="<%$ ConnectionStrings:omegaloveConnectionString %>"

SelectCommand="SELECT [RegionID], [Region] FROM [SubCountryCode] WHERE ([CountryID] = @CountryID)">

<SelectParameters>

<asp:ControlParameter ControlID="ddlCountry" Name="CountryID" PropertyName="SelectedValue"

Type="String" />

</SelectParameters>

</asp:SqlDataSource>
---------------------------------------------------------------
City :<br />

<asp:DropDownList ID="ddlCity" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCity_SelectedIndexChanged" DataSourceID="DSCity" DataTextField="City" DataValueField="City">

</asp:DropDownList>

<asp:SqlDataSource ID="DSCity" runat="server" ConnectionString="<%$ ConnectionStrings:omegaloveConnectionString %>"

SelectCommand="SELECT [City] FROM [WorldCities] WHERE (([CountryID] = @CountryID) AND ([RegionID] = @RegionID))">

<SelectParameters>

<asp:ControlParameter ControlID="ddlCountry" Name="CountryID" PropertyName="SelectedValue" Type="String" />

<asp:ControlParameter ControlID="ddlRegion" Name="RegionID" PropertyName="SelectedValue" Type="String" />

</SelectParameters>

</asp:SqlDataSource>

---------------------------------------------------------------------------------------------------------------------------------------------------------------
This is my behind code.
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using OmegaLove;using OmegaLove.UI;namespace OmegaLove.UI.Controls{    public partial class Search : BaseWebPart    {            protected void Page_Load(object sender, EventArgs e)        {        }                protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)        {            FlagImg.ImageUrl = "../images/flags/" + ddlCountry.SelectedValue + ".gif";            ResetRegion();            ResetCity();        }        protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)        {            ResetCity();        }        protected void ddlCountry_DataBound(object sender, EventArgs e)        {            ddlCountry.SelectedIndex = 39;            FlagImg.ImageUrl = "../images/flags/" + ddlCountry.SelectedValue + ".gif";        }               protected void ddlRegion_OnDataBound(object sender, EventArgs e)        {            ResetCity();        }        private void ResetRegion()        {            ddlRegion.Items.Clear();         //   ddlRegion.DataBind();            if (ddlRegion.Items.Count == 0)            {                ListItem item = new ListItem("Not Available");                ddlRegion.Items.Add(item);            }        }        private void ResetCity()        {            ddlCity.Items.Clear();        //    ddlCity.DataBind();            if (ddlCity.Items.Count == 0)            {                ListItem item = new ListItem("Not Available");                ddlCity.Items.Add(item);            }        }        protected void ddlCity_SelectedIndexChanged(object sender, EventArgs e)        {        }}}
 
 

View 6 Replies View Related

Get Number Of Results From SqlDataSource

Aug 27, 2007

Hi all,Is there a way of counting the number of results/rows from an SqlDataSource which uses a select statement like: "SELECT * FROM TABLE1". I need to get this value from the SqlDataSource into the Sub Page_Load. I don't want to bind to any gridviews, repeaters etc. I just want to get the number of rows/results from the SqlDataSource.Is there a way of doing this?Thanks 

View 4 Replies View Related

Getting Results From Sqldatasource In Codebehind

Dec 2, 2005

(New to ASP.net 2.0 and database connection)
 
I have created an sqldatasource on the aspx page, which works fine, but how do I get the results from it in the codebehind?

View 2 Replies View Related

How To Store My Results To Another Table

Dec 3, 2007

Hi guys, now i was able to get the results of the query i made. and the remaining problem now is how can i store the results to my database? here's the my code: protected void btnGenerate_Click(object sender, EventArgs e) { _con = new SqlConnection(database.evgConnection()); _comm = new SqlCommand("EV_usp_SearchNoticeLocation", _con); _comm.CommandType = CommandType.StoredProcedure; _comm.Parameters.AddWithValue("@Locationid", ddlLocation.SelectedValue); _adapt = new SqlDataAdapter(_comm); DataSet objDataset = new DataSet(); _adapt.Fill(objDataset); GridView1.DataSource = objDataset; GridView1.DataBind(); foreach(DataRow dr in objDataset.Tables[0].Rows) { Response.Write(dr["Docownerid"].ToString()); } } how can i store all the Docownerid to another database table? 

View 1 Replies View Related

How To Store The Results Of A Query In A Variable.

Jun 25, 2007

Can anyone tell me or point me in the direction of how I can store select query results to a variable in VB.NET? Im using the SqlDataSource control with dropdowns and textboxes for searching. I want to store the search results in a variable on the button click event.

View 2 Replies View Related

How Do I Store Results In TEMP TABLE?

Jul 7, 2005

I'm writing a search engine and I want to make a search and then, after
I've recieved the results, put them into some sort of temporary(in
mememory) table so that I can do another query on that temporary table.

I saw something about  temp tables (in T-SQL)  in the
help guide, but I still want to know how to do a query on a regular
table and then store those results in a temporary table to perform a
query on that. Could anyone show me some example or something?

View 3 Replies View Related

Do Data Mining Results Store At Some Where?

May 9, 2006

Do data mining results store at some files or in the database? I need the mining results at later time for reporting purpose.

View 1 Replies View Related

Can't Get Sqldatasource To Return Results From A Stored Procedure

Aug 1, 2006

I thought I would impliment a new feature of my web page using stored procedures and the SqlDataSource object, for practice or whatever, since I don't normally use that stuff.
This is the stored procedure:set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

-- =============================================
-- Author:Lance Colton
-- Create date: 7/31/06
-- Description:Find the contest winner
-- =============================================

ALTER PROCEDURE [dbo].[AppcheckContest]
-- Add the parameters for the stored procedure here

@BeginDate datetime = '1/1/2006',
@EndDate datetime = '12/31/2006',
@SectionID int = 10,
@WinnerID int = 0 OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.

SET NOCOUNT ON;

-- Insert statements for procedure here

SELECT top 1 @WinnerID = P.UserID
FROM cs_Posts P
WHERE P.PostDate BETWEEN @BeginDate AND @EndDate
AND P.SectionID = @SectionID
AND P.UserID <> 2100 -- I don't want to win my own contest...

AND SettingsID = 1000 -- This number could be different if i had more than one CS installed?

AND IsApproved = 1
ORDER BY NEWID() -- yes this is slow, but it works...

RETURN @WinnerID
END
 It's really simple - just needs to return the one randomly chosen integer userID. I've tested it in query designer or whatever it's called in Management Studio and it works fine there at least.
Thinking I was done the hard part, I created a new web form in visual studio, dropped a SqlDataSource on it, and used the 'configure data source' wizard from the smart tag to do all the work for me. I didn't have any trouble using the wizard to select my stored procedure, and i'm using the sa connection string to simplify my debugging. I tried using the FormParameter / FormField way of getting the output and setting the input parameters. I can't seem to get it working though. There's no errors or anything, just the output isn't coming through.
Here's the code from the aspx codebehind file:Partial Class Contest
Inherits System.Web.UI.Page

Protected Sub btnSelectWinner_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSelectWinner.Click
Dim stuff As New System.Web.UI.DataSourceSelectArguments
SqlDataSource1.Select(stuff)
SqlDataSource1.DataBind()
lblWinnerID.Text = SqlDataSource1.SelectParameters("WinnerID").ToString
End Sub
End Class
 As you can see, I wasn't sure if you're supposed to call databind() or select() to actually get the stored procedure to execute, so I tried both. I was hoping the last line of code there would set the label to the value contained in the @WinnerID parameter, but instead it sets it to "WinnerID".
Here's the code from the .aspx file. Most of this was generated by the Wizard, but I messed around with it a bit. <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Contest.aspx.vb" Inherits="Contest" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" Runat="Server">
<asp:Button ID="btnSelectWinner" runat="server" Text="Find Winner" />
<asp:Calendar ID="Calendar_From" runat="server"></asp:Calendar>
<asp:Calendar ID="Calendar_To" runat="server"></asp:Calendar>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:appcheck-csConnectionString-sa %>"
SelectCommand="AppcheckContest" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="False">
<SelectParameters>
<asp:FormParameter FormField="Calendar_From" Name="BeginDate" Type="DateTime" />
<asp:FormParameter FormField="Calendar_To" Name="EndDate" Type="DateTime" />
<asp:Parameter DefaultValue="10" Name="SectionID" Type="Int32" />
<asp:formParameter FormField="lblWinnerID" defaultvalue="666" Direction="InputOutput" Name="WinnerID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
 
<asp:Label ID="lblWinnerID" runat="server" Text="???"></asp:Label>
</asp:Content> 

View 3 Replies View Related

Is There A Way To Store The Results Of A Query In Another Table (SQLCE 3.0 Or Later)

Dec 8, 2007

I would like to perform a large query operation (which takes many seconds), and store that into a designated table which will act as basically a cache for that query. Is there a way to achieve this just using SQL, as opposed to using a data reader, then inserting that back into the designated table with a sqlceresultset.

View 3 Replies View Related

SqlDataSource Returns Fewer Results Than Original Sql Query

Aug 3, 2007

I have a query that I created in SqlServer and then merely copied the code to a sqldatasource. They are both connected to the same db, however the sqldatasource query only returns 6 records and when run in SqlServer, it returns 52 rows which is the correct number.
 Any ideas on what might be causing this? There are no filters on the sqldatasource. It only has that one query. Do they differ in the way they execute sql code?
 Thanks for any help!

View 1 Replies View Related

SqlDataSource And SSMSE Returning Different Results For Same SELECT Command

Oct 2, 2007

Hi,
Hope you guys won't mind this rather newbie question.  I'm writing a simple blog page for my website and have created a SqlDataSource which queries the database for a list of blog post titles (from the web.Blog table) and the number of comments (from the web.BlogComments table).  The SqlDataSource control is:
<asp:SqlDataSource ID="sourceBlogArticles" ProviderName="System.Data.SqlClient" connectionString="<%$ ConnectionStrings:myDatabase %>" runat="server" SelectCommand="SELECT gb.blogID, gb.title, gb.description, gb.tags, gb.dateAdded, COUNT(gbc.blogID) AS noOfComments FROM web.Blog gb LEFT OUTER JOIN web.BlogComments gbc ON gb.blogID = gbc.blogID GROUP BY gb.blogID, gb.title, gb.description, gb.tags, gb.dateAdded ORDER BY gb.dateAdded"></asp:SqlDataSource>
This works perfectly well if each blog entry in the web.Blog table has associated comments in the web.BlogComments table.  However, if there are no comments yet defined in the web.BlogComments table for that blogID then no row is returned in ASP.Net (as checked with a GridView control or similar linked to the data source to view what I get)
 HOWEVER, I think the SELECT command IS correct: if I use the select command as a query in SQL Server Managment Studio Express, I do get the rows returned, with 0 for the number of comments which is what I would expect for that query:
blogID, title, description, tags, dateAdded, noOfComments
1, title 1, description for title 1, tag1, 2007-09-27 06:49:03.810, 32, title 2, description for title 2, tag2, 2007-09-27 06:49:37.513, 03, title 3, description for title3, tag3, 2007-10-02 18:21:30.467, 0
Can anyone help?  The result from the SSMSE query is what I want, yet when I use the very same SELECT statement in my SqlDataSource I don't get any rows returned if the BlogComment count is zero (in the above example I get only the first row).  Many thanks for any suggestions!

View 6 Replies View Related

Store Procedure To Copy View Results To A Table

Feb 17, 2014

I am looking for an example of a store procedure that will run a existing view and copy the results to a table. Every time it runs the table needs to be truncated. Will run once a day.

My view is a follows

SELECT PClass
FROM mydatabase.dbo.ProductClassDes
WHERE (ProductClass <> '_RBS') AND (ProductClass <> '_EDT') AND (ProductClass <> '_BMS') AND (ProductClass <> '_PAZ') AND (ProductClass <> '_PBC')

View results need to be copied to a table tblCurrentProductClasses that will only contain one field PClass.

View 2 Replies View Related

Does It Store All The Results To Tempdb Database When I Query Against A Large Table Which Joins Another Table?

Jun 25, 2007

Hi, all experts here,



I am wondering if tempdb stores all results tempararily whenever I query a large fact table with over 4 million records which joins another dimension table? Since each time when I run the query, the tempdb grows to nearly 1GB which nearly runs out all the space on my local system drive, as a result the performance totally down. Is there any way to fix this problem? Thanks a lot in advance and I am looking forward to hearing from you shortly for your kind advices.



With best regards,



Yours sincerely,



View 11 Replies View Related

Where Can I Store The Mining Results From Mining Models In SQL Server 2005 Data Mining Engine?

Apr 26, 2006

Hi, all here,

I am wondering where can I store my mining results in data mining engine? For example, I got mining results like accuracy chart, decision trees, and other formats of results based on different mining algorithms I used for my data mining, so where can I actually store the results for reporting service use later? Is it possible to do that in SQL Server 2005?

Thanks a lot for any help and guidance in advance.

View 4 Replies View Related

SELECT A Single Row With One SqlDataSource, Then INSERT One Of The Fields Into Another SqlDataSource

Jul 23, 2007

What is the C# code I use to do this?
I'm guessing it should be fairly simple, as there is only one row selected. I just need to pull out a specific field from that row and then insert that value into a different SqlDataSource.

View 7 Replies View Related

Is There A Way To Hold The Results Of A Select Query Then Operate On The Results And Changes Will Be Reflected On The Actual Data?

Apr 1, 2007

hi,  like, if i need to do delete some items with the id = 10000 then also need to update on the remaining items on the with the same idthen i will need to go through all the records to fetch the items with the same id right?  so, is there something that i can use to hold those records so that i can do the delete and update just on those records  and don't need to query twice? or is there a way to do that in one go ?thanks in advance! 

View 1 Replies View Related

SQL Server 2008 :: Elegant Way For Returning All Results When Subquery Returns No Results?

Mar 25, 2015

I have four tables: Customer (CustomerId INT, CountyId INT), County (CountyId INT), Search(SearchId INT), and SearchCriteria (SearchCriteriaId INT, SearchId INT, CountyId INT, [others not related to this]).

I want to search Customer based off of the Search record, which could have multiple SearchCriteria records. However, if there aren't any SearchCriteria records with CountyId populated for a given Search, I want it to assume to get all Customer records, regardless of CountyId.

Right now, I'm doing it this way.

DECLARE @SearchId INT = 100
SELECT * FROM Customer WHERE
CountyId IN
(
SELECT CASE WHEN EXISTS(SELECT CountyId FROM SearchCriteria WHERE SearchId = @SearchId)
THEN SearchCriteria.CountyId

[Code] .....

This works; it just seems cludgy. Is there a more elegant way to do this?

View 4 Replies View Related

Need To Display Results Of A Query, Then Use A Drop Down List To Filter The Results.

Feb 12, 2008

Hello. I currently have a website that has a table on one webpage. When a record is clicked, the primary key of that record is transfered in the query string to another page and fed into an sql statement. In this case its selecting a project on the first page, and displaying all the scripts for that project on another page. I also have an additional dropdownlist on the second page that i use to filter the scripts by an attribute called 'testdomain'. At present this works to an extent. When i click a project, i am navigated to the scripts page which is empty except for the dropdownlist. i then select a 'testdomain' from the dropdownlist and the page populates with scripts (formview) for the particular test domain. what i would like is for all the scripts to be displayed using the formview in the first instance when the user arrives at the second page. from there, they can then filter the scripts using the dropdownlist.
My current SQL statement is as follows.
SelectCommand="SELECT * FROM [TestScript] WHERE (([ProjectID] = @ProjectID) AND ([TestDomain] = @TestDomain))"
So what is happening is when testdomain = a null value, it does not select any scripts. Is there a way i can achieve the behaivour of the page as i outlined above? Any help would be appreciated.
Thanks,
James.

View 1 Replies View Related

Stored Proc Results Are Displaying In The Messages Tab Instead Of Results Tab- URGENT

May 14, 2008




Hi All,
I have a stored proc which is executing successfully...but the results of that stored proc are displaying in the Messages Tab instaed of results Tab. And in the Results Tab the results shows as 0..So, Any clue friends..it is very urgent..I am trying to call this stored proc in my Report in SSRS as well but the stored proc is not displaying there also...Please help me ASAP..

Thanks
dotnetdev1

View 4 Replies View Related

Individual SqlDataSource() Or Common SqlDataSource() ?

Mar 8, 2007

i am using visual web developer 2005 with SQL Express 2005 with VB as the code behindi have one database and three tables in itfor manipulating each table i am using separate SqlDataSource() is it sufficient to use one SqlDataSource() for manipulating all the three tables ? i am manipulating all the tables in the same page only please help me

View 1 Replies View Related

Mind-boggling Gridview Results! Different Results For Different Teams..

Jun 18, 2008

Hi all, I have the following SQLDataSource statement which connects to my Gridview:<asp:SqlDataSource ID="SqlDataSourceStandings" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"  SelectCommand="SELECT P.firstName, P.lastName, T.teamName, IsNull(P.gamesPlayed, 0) as gamesPlayed, IsNull(P.plateAppearances,0) as plateAppearances, IsNull( (P.plateAppearances - (P.sacrifices + P.walks)) ,0) as atbats, IsNull(P.hits,0) as hits, P.hits/(CONVERT(Decimal(5,2), IsNull(NullIF(P.atbats, 0), 1))) AS [average], (P.hits + P.walks)/(CONVERT(Decimal(5,2), IsNull(NullIF( (P.atbats + P.sacrifices + P.walks) , 0), 1)))  AS [OBP], (P.hits - (P.doubles + P.triples + P.homeRuns) + (2 * P.doubles) + (3 * P.triples) + (4 * P.homeRuns)) / (CONVERT(Decimal(5,2), IsNull(NullIF(P.atbats, 0), 1))) AS [SLG], P.singles, P.doubles, P.triples, P.homeRuns, P.walks, P.sacrifices, P.runs, P.rbis FROM Players P INNER JOIN Teams T ON P.team = T.teamID ORDER BY P.firstName, P.lastName"></asp:SqlDataSource>There are 8 teams in the database, and somehow the average and obp results are as expected for all teams except where T.teamID = 1.  This doesn't make sense to me at all!  For example, I get the following results with this same query: First NameLast NameTeamGPPAABHAVGOBPSLG1B2B3BHRBBSACRRBI

BrianAustinHope83432230.7187500.7352941.15625014612201221

GabrielHelbigSafe Haven62119141.0000000.9375002.1428576404111519

MarkusJavorSafe Haven82927200.8695650.8000001.21739114501021218

RobBennettMelville83029240.8275860.8333331.55172411904102117

AdamBiesenthalSafe Haven82929210.9130430.9130431.56521712631001015

ErikGalvezMelville82625180.7200000.7307691.24000011322101015 As you can see, all teams except for Safe Haven's have the correct AVG and OBP.  Since AVG is simply H/AB, it doesn't make sense for Gabriel Helbig's results to be 1.00000. Can anyone shed ANY light on this please?Thank you in advance,Markuu  ***As a side note, could anyone also let me know how I could format the output so that AVG and OBP are only 3 decimal places? (ex: 0.719 for the 1st result)*** 

View 2 Replies View Related

Removing Individual Results From A Paged Set Of Results.

Oct 19, 2007

Hi,
I have a web form that lets users search for people in my database they wish to contact. The database returns a paged set of results using a CTE, Top X, and Row_number().
I would like to give my users to option of removing individual people from this list but cannot find a way to do this.
I have tried creating a session variable with a comma delimited list of ID's that I pass to my sproc and use in a NOT IN() statement. But I keep getting a "Input string was not in a correct format." Error Message.
Is there any way to do this? I am still new to stored procedures so any advice would be helpful.
Thanks
 

View 3 Replies View Related

PASTE SQL RESULTS INTO EXCEL - Funny Results

Jan 30, 2008

Hi, when I copy and paste results from query analyzer into Excel it appears that values with zeroes at the end loose the zeroes. Example, if I copy and paste V128.0 into an Excel cell it comes out as V128 or if I copy 178.70 it displays as 178.7 - any ideas? I'm using SQL Enterprise Manager for 2000.

View 6 Replies View Related

Store Procedure Not Store

Nov 20, 2013

My store Procedure is not save in Strore Procedure folder at the time of saving it give me option to save in Project folder and file name default is SQLQuery6.sql when i save it after saving when i run my store procedure

exec [dbo].[SP_GetOrdersForCustomer] 'ALFKI'

I am getting below error :

Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'dbo.SP_GetOrdersForCustomer'.

View 13 Replies View Related

Call Store Procedure From Another Store Procedure

Nov 13, 2006

I know I can call store procedure from store procedure but i want to take the value that the store procedure returned and to use it:

I want to create a table and to insert the result of the store procedure to it.

This is the code: Pay attention to the underlined sentence!

ALTER PROCEDURE [dbo].[test]



AS

BEGIN

SET NOCOUNT ON;



DROP TABLE tbl1

CREATE TABLE tbl1 (first_name int ,last_name nvarchar(10) )

INSERT INTO tbl1 (first_name,last_name)

VALUES (exec total_cash '8/12/2006 12:00:00 AM' '8/12/2006 12:00:00 AM' 'gilad' ,'cohen')

END

PLEASE HELP!!!! and God will repay you in kind!

Thanks!

View 7 Replies View Related

Asp:sqldatasource - Sum And Contains

Aug 20, 2006

I have an asp:sqldatasource which is bound to a gridviewIn addition to this I would like it to a) see if there is a specif row/ item in it (ie item_id = 10 for any of the rows it has received) as I conditionally want to show another item outside of the gridview subject to if it is in the gridview or notb) show the sum of all the values within a certain column of returned rowsMany thanks

View 1 Replies View Related

SqlDataSource

Oct 11, 2006

How do I get the result of this select into a variableDim sqldsFindUserId As SqlDataSource = New SqlDataSource        sqldsFindUserId.ConnectionString = ConfigurationManager.ConnectionStrings("bluConnectionString2").ToString        sqldsFindUserId.SelectCommandType = SqlDataSourceCommandType.Text        Dim myUserIdCmd As String = "select pkUser from tblUsers where strDisplayName='" + myDisplayname + ""        sqldsFindUserId.SelectCommand = myUserIdCmd  '  The result  of this select statement is to be stored in a variable, how do I do it?

View 2 Replies View Related

SqlDatasource

Dec 18, 2006

Hi all

View 2 Replies View Related

Sqldatasource

Jan 15, 2007

hi all,
in all my 2.0 learnings and books i keep coming across the page element <asp:sqldatasource>.
I have always (in 1.1) used server side connections and adapters to bind my Sql datasets to any control needed.  Now that im learning 2.0 im finding it difficult to understand using control on the page to bind my data.  Can someone explain the benefits of using this data source?  Ideally i would like to keep my data access layer separate from my presentation layer but i'd really like to understand why this method seems so popular.
thanks in advance,
mcm

View 2 Replies View Related

Using SQLDataSource

Feb 23, 2007

Hi, I am new to ASP.NET 2.0 and I am trying to use VWB to bind my web site to a SQL Express edition. I used SQLDataSource to specify the .mdf file so I can connect to my tables but when I click on the advanced button to generate the Insert, Update, Delete SQL I find it grayed out and it cannot be clicked. I looked into several tutorials online and I couldn't find the problem, can anyone explain what I am missing or doing wrong? Any suggestion is very appreciated. Thanks 

View 2 Replies View Related

SQLDataSource

Mar 30, 2007

SELECT * FROM [CONTACTS] WHERE @ddl_value LIKE '%@txt_value%'
 
Why doesn't this not working
I am using SQLdatasource control to bind a gridview
If my query is wrong then what might be the correct one to work with like operator in the sqldatasource
Can any ony help me!

View 4 Replies View Related

SqlDataSource

Apr 12, 2007

Hello All,
 I have quick question ..
In my aspx page i have gridview  and Sql DataSource  object as you can see
<asp:sqldatasource id="SqlDataSource1" runat="server" ></asp:sqldatasource>
 
<asp:gridview id="GridView1" runat="server" allowpaging="True" allowsorting="True" autogeneratecolumns="False" datasourceid="SqlDataSource1">
<columns>
<asp:boundfield datafield="breakdownid" headertext="breakdownid" insertvisible="False"
readonly="True" sortexpression="breakdownid" />
<asp:boundfield datafield="ticketno" headertext="ticketno" sortexpression="ticketno" />
<asp:boundfield datafield="systemtype" headertext="systemtype" sortexpression="systemtype" />
<asp:boundfield datafield="break_date" headertext="break_date" readonly="True" sortexpression="break_date" />
<asp:boundfield datafield="subject" headertext="subject" sortexpression="subject" />
<asp:boundfield datafield="status" headertext="status" sortexpression="status" />
<asp:boundfield datafield="prioritylevel" headertext="prioritylevel" sortexpression="prioritylevel" />
<asp:boundfield datafield="mobiletype" headertext="mobiletype" sortexpression="mobiletype" />
</columns>
</asp:gridview>
In codebehind file  i call a function to get data from database. what i want is to bind the result to the sqlDataSourse not the gridview.
 I need to have the SqlDataSourse thier..  Any help please
 
 
Sub Page_load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim objReader As New Dynamic.Reportsdemo
SqlDataSource1 = .objReader.Get_Tickets(1, 0, "all")
 
SqlDataSource1.DataBind()
objReader.objconnection.Close()
 
End If
End Sub
Thanks.
 
 

View 1 Replies View Related







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