Manipulating Data In Sqldatasource

Jan 16, 2008

[I am new to asp.net]

Assume I have a databse for "products"; product id is a primary key.

Here is what I am trying to:

1. DetailsView for a product (eg id = 1110) (I got this far)

2. how can I list other products starting with 111x id

3. I also to show them on same page as 1110 as "parent" 111x as children

 Thanks,

View 5 Replies


ADVERTISEMENT

Manipulating Large Ntext Data With ADO Recordset

Mar 20, 2000

I am having a problem writing a large amount of ntext data to a field within an ADO recordset. I am using the append chunk method but it does not seem to work. The SQL 7 field will hold the data its only about 60K.

View 1 Replies View Related

Manipulating Text,nText Data Types Filed In Tsql

Jul 12, 2006

I have to run a dynamic sql that i save in the database as a TEXT data type(due to a large size of the sql.) from a .NET app.  Now i have to run this sql from the stored proc that returns the results back to .net app. I am running this dynamic sql with sp_executesql like this..
EXEC sp_executesql @Statement,N'@param1 varchar(3),@param2 varchar(1)',@param1,@param2,GO
As i can't declare text,ntext etc variables in T-Sql(stored proc), so i am using this method in pulling the text type field "Statement".
DECLARE @Statement varbinary(16)SELECT @Statement = TEXTPTR(Statement)FROM table1 READTEXT table1.statement @Statement 0 16566
So far so good, the issue is how to convert @Statment varbinary to nText to get it passed in sp_executesql.
Note:- i can't use Exec to run the dynamic sql becuase i need to pass the params from the .net app and Exec proc doesn't take param from the stored proc from where it is called.
I would appreciate if any body respond to this.
 
 
 

View 2 Replies View Related

Manipulating Datetime

Dec 16, 1998

Hi ppl

How do I subtract, say an integer from a datetime value. I tried to use the Convert function but wont work.
All I want to do in my SP is subtract an integer from getdate() and do a query based on the result
I get from that subtraction.

ex: getdate()-15 ?????????????????????????????????

View 1 Replies View Related

Manipulating Strings

May 7, 2008

Hi All

I've got a list of IDs seperated by commas and I want to get each indivdual ID and insert them into a table. Has anybody got any ideas how this can be done?

Thanks

View 6 Replies View Related

Manipulating Dates In SQL

Jan 18, 2007

I need to generate a date range, based on the current date (or an input date). I can get the correct dates using VB, but I haven't worked out the TSQL Syntax for them yet. Can anyone tell me the TSQL syntax for manipulating dates in the following way...?

Start Date... This is the first day of the month, one year ago... in VB I worked it out as...

dateadd("yyyy",-1,(cdate(cstr(Year(now))+"-"+cstr(Month(now))+"-01")))

End Date... This is the last day of the previous month... in VB I worked this one out as...

dateadd("d",-1,(cdate(cstr(Year(now))+"-"+cstr(Month(now))+"-01")))

eg. for today 18/01/2007 I would get a Start date of 01/01/2006 and an End date of 31/12/2006

Any help would be appreciated.

View 4 Replies View Related

Manipulating Varchars As Datetime

Aug 10, 2007

Hi all,
I am a little weak at SQL, so bear with me.
Can anyone give me an SP which uses "Between" to Display all Dates
BETWEEN a fromDate and toDate???
Two conditions
1.Both Dates are stored as varchar.
2. I should be able to get the dates even if years are different, say between 20th December 2006 and 3rd January 2007
3.Is there a way to extract the yearDiff? 
Regards,
Naveen

View 2 Replies View Related

Manipulating Large Tables

Feb 15, 2008

I'm in the midst of a long file conversion job. Today I found that one of the tables (converted from csv) to be 6.7 million records. My sql script which I use to reconfigure the weird original date format, into something the rest of the planet uses, times out due to the size.

Does anyone please know of a file utility to automagically split sql server 2005 tables for later re-combining once my scripts have successfully completed their task on the smaller tables?

View 7 Replies View Related

Manipulating A SqlDatSource UpdateCommand In Code-behind

Jul 20, 2007

We've got an employee database that I'm modifying to include two photos of each employee, a small thumbnail image and a full-size image.  The HR department maintenance page contains a listbox of employee names, which, when clicked, populates a detailsview control.To get the images to display and be updatable, I've had to structure the following SqlDatasource and DetailsView:
1    <asp:DetailsView ID="dvEmp" runat="server"2      AutoGenerateRows="false"3      DataSourceID="dsEmpView"4      DataKeyNames="empID">5    <Fields>6    <asp:CommandField ShowEditButton="true" ShowCancelButton="true" ShowInsertButton="true" />7    <asp:BoundField HeaderText="Name (Last, First)" DataField="empname" />8    <asp:TemplateField HeaderText="Thumbnail photo">9    <ItemTemplate>10   <asp:Image ID="imgThumbnail" runat="server" ImageUrl='<%# formatThumbURL(DataBinder.Eval(Container.DataItem,"empID")) %>' />11   </ItemTemplate>12   <EditItemTemplate>13   <asp:Image ID="imgThumbHidden" runat="server" ImageUrl='<%# Bind("thumbURL") %>' Visible="false" />14   <asp:FileUpload ID="upldThumbnail" runat="server" />15   </EditItemTemplate>16   </asp:TemplateField>17   <asp:TemplateField HeaderText="Full Photo">18   <ItemTemplate>19   <asp:Image ID="imgPhoto" runat="server" ImageUrl='<%# formatImageURL(DataBinder.Eval(Container.DataItem,"empID")) %>'  />20   </ItemTemplate>21   <EditItemTemplate>22   <asp:Image ID="imgPhotoHidden" runat="server" ImageUrl='<%# Bind("photoURL") %>' Visible="false" />23   <asp:FileUpload ID="upldPhoto" runat="server" />24   </EditItemTemplate>25   </asp:TemplateField>26   </Fields>27   </asp:DetailsView>28   29   <asp:SqlDataSource ID="dsEmpView"30     runat="server"31     ConnectionString="<%$ ConnectionStrings:eSignInConnectionString %>"32     OnInserting="dsEmpView_Inserting"33     OnUpdating="dsEmpView_Updating"34     SelectCommand="SELECT empID, empname, photoURL, thumbURL FROM employees where (empID = @empID)"35     InsertCommand="INSERT INTO employees (empname, photoURL, thumbURL) values(@empname, @photoURL, @thumbURL)"36     UpdateCommand="UPDATE employees SET empname=@empname, photoURL=@photoURL, thumbURL=@thumbURL WHERE (empID = @empID)">37     <SelectParameters>38       <asp:ControlParameter ControlID="lbxEmps" Name="empID" PropertyName="SelectedValue" Type="Int16" />39     </SelectParameters>40   </asp:SqlDataSource>41   42   -----43   44   Protected Sub dsEmpView_Updating(ByVal sender As Object, ByVal e As SqlDataSourceCommandEventArgs)45     Dim bAbort As Boolean = False46     Dim bThumb(), bPhoto() As Byte47     If e.Command.Parameters("@ename").Value.trim = "" Then bAbort = True48     Dim imgT As FileUpload = CType(dvEmp.FindControl("upldThumbnail"), FileUpload)49     If imgT.HasFile Then50       Using reader As BinaryReader = New BinaryReader(imgT.PostedFile.InputStream)51         bThumb = reader.ReadBytes(imgT.PostedFile.ContentLength)52         e.Command.Parameters("@thumbURL").Value = bThumb53       End Using54     End If55     Dim imgP As FileUpload = CType(dvEmp.FindControl("upldPhoto"), FileUpload)56     If imgP.HasFile Then57       Using reader As BinaryReader = New BinaryReader(imgP.PostedFile.InputStream)58         bPhoto = reader.ReadBytes(imgP.PostedFile.ContentLength)59         e.Command.Parameters("@photoURL").Value = bPhoto60       End Using61     End If62     e.Cancel = bAbort63   End SubIf the user updates both images at the same time by populating their respective FileUpload boxes, everything works as advertized.  But if the user only updates one image (or neither image), things break. If they upload, say, just the full-size photo during an update, then it gives the error "System.Data.SqlClient.SqlException: Operand type clash: nvarchar is incompatible with image".I think this error occurs because the update command is trying to set the parameter "thumbURL" without having any actual data to set.  But since I really don't want this image updated with nothing, thereby erasingthe photo already in the database, I'd rather remove this parameter from the update string.So, let's remove the parameter that updates that image by adding the following code just after the "End Using" lines: Else
Dim p As SqlClient.SqlParameter = New SqlClient.SqlParameter("@thumbURL", SqlDbType.Image)
e.Command.Parameters.Remove(p)
(Similar code goes into the code block that handles the photo upload)Running the same update without an image in the thumb fileupload box, I now get this error: "System.ArgumentException: Attempted to remove an SqlParameter that is not contained by this SqlParameterCollection."Huh?  It's not there?  Okay, so lets work it from the other end: let's remove all references to the thumbURL and photoURL from the dsEmpView datasource.  We'll make its UpdateCommand = "UPDATE employees SET empname=@empname WHERE (empID = @empID)", and put code in the dsEmpView_Updating sub that adds the correct parameter to the update command, but only if the fileupload box has something in it.  Therefore: If imgT.HasFile Then
Using reader As BinaryReader = New BinaryReader(imgT.PostedFile.InputStream)
bThumb = reader.ReadBytes(imgT.PostedFile.ContentLength)
e.Command.Parameters.Add(New SqlClient.SqlParameter("@thumbURL", SqlDbType.Image, imgT.PostedFile.ContentLength))
e.Command.Parameters("@thumbURL").Value = bThumb
End Using
End If
(Similar code goes into the code block that handles the photo upload)But reversing the angle of attack only reverses the error. Uploading only the photo and not the thumb image results in: "System.Data.SqlClient.SqlException: The variable name '@photoURL' has already been declared. Variable names must be unique within a query batch or stored procedure."So now it's telling me the parameter IS there, even though I just removed it.ARRRGH!What am I doing wrong, and more importantly, how can I fix it?Thanks in advance. 

View 5 Replies View Related

Manipulating String To Return First Value Before Space

Dec 10, 2001

I have data coming back like below

140 KB 8 KB 1450 KB

I would like to manipulate the string to pull out only the number value. There is always a space between the number and the "KB". Looked at replace but got stuck, any help appreciated.

View 3 Replies View Related

Manipulating Individual Fields Of A View

Nov 13, 2007

In my database I have a table for Users, with an int primary key, and a table for Connections, with a combined primary key consisting of two UserID foreign keys. (the smallest first)

At the point I am stuck I have one UserID, lets call it current_user, and a column returned by a select statement consisting of UserIDs. Some of these IDs will likely be smaller than current_user, and some will likely be larger.

What i need to do is construct a view of two columns, combining each of the UserIDs in the column I have with current_user, with the smallest UserID of each pair residing in the first column, and the largest in the second column.

The point of this is to then SELECT the connections identified by the UserID pairs.

I suspect I could accomplish this if I could set individual fields in the a view, but I seem to have missed (or forgotten) that lecture. Anybody want to clue me in?

View 6 Replies View Related

Manipulating Multiple Count(*) Queries

Dec 15, 2006

Hi,
I'm having problems manipulating the results from multiple count(*) queries.

I have a table 'RECOMMENDATIONS' holding a field called 'SCORE'. This field holds a number from 1 to 10 and has no null or zero figures.

I currently have the following three queries:
1) SELECT COUNT(*) FROM RECOMMENDATIONS WHERE SCORE IN (1,2,3,4,5,6)
2) SELECT COUNT(*) FROM RECOMMENDATIONS WHERE SCORE IN (9,10)
3) SELECT COUNT(*) FROM RECOMMENDATIONS

I now need to combine these three queries so that i can divide and multiply the resulst: (query 2/query 1)*query 3

My initial idea was:
SELECT (COUNT(*)/(SELECT COUNT(*) FROM RECOMMENDATIONS WHERE SCORE IN (1,2,3,4,5,6)))* (SELECT COUNT(*) FROM RECOMMENDATIONS) FROM RECOMMENDATIONS WHERE SCORE IN (9,10)

... but this gives a result of "0". I then stripped out the multiplication section to see if the divide was working:
SELECT COUNT(*)/(SELECT COUNT(*) FROM RECOMMENDATIONS WHERE SCORE IN (1,2,3,4,5,6)) FROM RECOMMENDATIONS WHERE SCORE IN (9,10)

... and again the result was "0"

Please could someone help me!!

Ian

View 2 Replies View Related

Manipulating Table In Store Procedure

Mar 5, 2007

Hi
I am new to SQL programming. This is what I am trying to do in store procedure.
Alter a table - adding two columns.
Then update those columns
Both the above action in same procedure .
When I execute them - it complains that the columns I am adding in the first part of store procedure , does not exists.
So the SP looks like this
create store procedure <name> as
alter table <name> ADD
column_1 nvarchar (256),
column_2 nvarchar (256);

update table
set
column_1 = <condition>
column_2 = <condition>

The SQL complains -
invalid column name column_1
invalid column name column_2

Can some one help please...

View 3 Replies View Related

Manipulating The Result Set Of One Stored Procedure From Another....

Jul 23, 2005

Hi,I have one stored procedure that calls another ( EXEC proc_abcd ). I wouldlike to return a result set (a temporary table I have created in theprocedure proc_abcd) to the calling procedure for further manipulation. Howcan I do this given that TABLE variables cannot be passed into, or returnedfrom, a stored procedure?Thanks,RobinExample: (if such a thing were possible):DECLARE @myTempTable1 TABLE ( ID INT NOT NULL )DECLARE @myTempTable2 TABLE ( ID INT NOT NULL )...../*Insert a test value into the first temporary table*/INSERT INTO @myTempTable1 VALUES ( 1234 )...../*Execute a stored procedure returning another temporary table ofvalues.*/EXEC proc_abcd @myTempTable2 OUTPUT......../*Insert the values from the second temporary table into the first.*/SELECT * INTO @myTempTable1 FROM @myTempTable2

View 1 Replies View Related

Transact SQL :: Manipulating Full Name Field

Sep 22, 2015

I have a column with Full Names (e.g. Jane Doe)...how can I transform it via t-sql for end resutl Doe, Jane?

View 8 Replies View Related

Manipulating GetDate() To Start At Midnight Rather Than Now

Apr 29, 2008

Hi Folks,

I am trying to find the best way to use the getDate() function in SQL Server CE to return a date and time which starts at midnight rather than the value of now which getDate() returns.

When running getDate I get the value of 29/04/2008 10:48:33 returned, but I want to return 29/04/2008 00:00:00 instead.
The only way I can see to do this is like so:




Code Snippet

--SQL to get shifts for next 7 days.
select * from SHIFTS

where STARTDATE between
--Today at midnight 2008-04-29 00:00:00.000

(convert(datetime,

convert(nvarchar,(datepart(yyyy,getdate()))) + '/'

+

convert(nvarchar,(datepart(MM,getdate()))) + '/'

+

convert(nvarchar,(datepart(dd,getdate())))

))

and
--7 days from now at night 2008-05-05 00:00:00.000
(

convert( datetime,

convert(nvarchar,(datepart(yyyy,getdate()+6))) + '/'

+

convert(nvarchar,(datepart(MM,getdate()+6))) + '/'

+

convert(nvarchar,(datepart(dd,getdate()+6)))

))





Is there a better way to do this rather than this long winded method?

Thanks,

Morris

View 1 Replies View Related

Manipulating A Text Box In Custom Code.

Nov 21, 2006

Hi there,

A simple question I hope. I have got a textbox on a report and I'm trying to populate it by calling a custom assembly. I know I can reference it directly in the textbox (this works) but I am trying to do this from the code block. The following code didn't work:

Protected Overrides Sub OnInit()
ReportItems!textbox2.Value = POCCustomAssembly.CustAssembly.Hello()
End Sub

The TextBox is called textbox2 and the custom assembly simply returns a string.

I get an error message "The is an error on line 1 of custom code: [BC30469] Reference to a non-shared member requires an object reference".

What am I doing wrong?

View 6 Replies View Related

Re-use Data From SqlDataSource

Dec 11, 2006

I have a page containing a FormView, which gets its data from a SqlDataSource control and displays details of a job.  Two of the fields are location and job title.  I want to re-use this data to create a dynamic page title.  I know I can do this by setting the Page.Title to what I want to,  but do I have access to the data outside of the FormView to which the data source is bound?  If so how?   Or will I have to perform an additional SELECT statement to get this data again?

View 2 Replies View Related

Using The SqlDataSource To Get Data .net 2.0

Feb 14, 2006

I am used to using asp.net 1.1
and I want to do the equivilent of the following with an SqlDataSource


da.fill(dst1)
lbl.text=dst1.tablename(0).fieldname


and what this does is fills the dataset with the information from the select command in the dataadapter and then gets the value for the first row of the fieldname

It doesnt seem like this should be that big of a deal, but it has become very frustrating trying to find the answer, does anyone know how to do this? Please post some demo code if possible

View 2 Replies View Related

Using Data From SqlDataSource

Mar 9, 2006

Hi Everybody,I have an ordinary SqlDataSource on my page <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:P4SConnection %>"                ProviderName="<%$ ConnectionStrings:P4SConnection.ProviderName %>" SelectCommand="SELECT CO_Id,CT_Name,CO_Username,CO_Password,CO_Company,CO_Email,CT_Id,CT_Position,CT_Admin,                CO_Session,CO_LastLogin FROM company_contact LEFT JOIN company ON company_contact.CT_Company = company.CO_Id WHERE (CT_Username= & LCase(txtName.Text) & ">            </asp:SqlDataSource>How do i use any of these values?I know I can display the values in a GridView or something but I dont want to display them.I originaly was using ODBC and just used the followingDim Row As DataRow = thisTable.Rows(0)            Dim lP_ID As String = Row(0).ToString()            Dim TheContact As String = Row(1).ToString()            Dim theName As String = Row(2).ToString()            Dim thePassword As String = Row(3).ToString()            Dim TheCompany As String = Row(4).ToString()            Dim TheEmail As String = Row(5).ToString()            Dim lP_ContactID As String = Row(6).ToString()            Dim ThePosition As String = Row(7).ToString()            Dim bAdmin As Boolean = Row(8).ToString()            Dim sP_Session As String = Row(9).ToString()            Dim sP_Last As String = Row(10).ToString()Then I could use the values wherever I wanted.How do I do this with a SqlDataSource?Thanks,G

View 4 Replies View Related

How To Retrieve Data From Sqldatasource?

Jul 18, 2006

Okay, I used the SQLDataSource control to get my data from the database
table. What or how do I retrieve individual data from the
sqldatasource? I want to do some string comparison and manipulation
before I display it to the browser. How can this be accomplish?

Help is appreciated.

View 21 Replies View Related

Filtering Data Using Sqldatasource

Oct 12, 2006

i HAVE TRIED THE FOLLOWING CODE BUT ITS NOT WORKING AS I WANT TO FILTER IT ACCORDING TO THE VALUE OF DROPDOWNLIST  I HAVE TRIED CONFIGURE THE SQLDATASOURCE. DATASOURCE MODE PROPERTY IS SET TO THE DATASERSTILL IT IS NOT SHOWING ANY RESULTS <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   <html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title>Untitled Page</title></head><body>    <form id="form1" runat="server">    <div>        <h3>Search Jobs</h3>         <table cellspacing="10">                      <tr>            <td valign="top" style="height: 162px">              <table border="0">                <tr>                  <td valign="top" style="width: 70px">                      Location</td>                  <td><asp:DropDownList runat="server" id="CountryListBox" AppendDataBoundItems="True"                                        DataSourceID="CountrySqlDataSource"                                         DataTextField="location" DataValueField="location" AutoPostBack="True" >                        <asp:ListItem Selected="True" >(Show All)</asp:ListItem>                      </asp:DropDownList>                  </td>                </tr>                <tr>                  <td style="width: 70px">                      Skills</td>                  <td><asp:TextBox runat="server" id="LastNameTextBox" Text="*" /></td>                </tr>                <tr>                  <td style="width: 70px"></td>                  <td><asp:Button runat="server" id="FilterButton" Text="Filter Results" /></td>                </tr>              </table>            </td>             <td valign="top" style="width: 587px; height: 162px;">                              <asp:GridView ID="EmployeesGridView"                DataSourceID="SqlDataSource2"                 DataKeyNames="employeeID"                AutoGenerateColumns="False"                AllowSort="True"                RunAt="server" Height="143px">                                <HeaderStyle backcolor="Navy"                  forecolor="White"/>                                  <RowStyle backcolor="White"/>                                <AlternatingRowStyle backcolor="LightGray"/>                                <EditRowStyle backcolor="LightCyan"/>                  <Columns>                      <asp:BoundField DataField="employeeID" HeaderText="employeeID" ReadOnly="True" SortExpression="employeeID" />                      <asp:BoundField DataField="employeeName" HeaderText="employeeName" SortExpression="employeeName" />                      <asp:BoundField DataField="companyName" HeaderText="companyName" SortExpression="companyName" />                      <asp:BoundField DataField="jobSkills" HeaderText="jobSkills" SortExpression="jobSkills" />                      <asp:BoundField DataField="experiance" HeaderText="experiance" SortExpression="experiance" />                      <asp:BoundField DataField="location" HeaderText="location" SortExpression="location" />                  </Columns>              </asp:GridView>            </td>                          </tr>                    </table>                    <asp:SqlDataSource ID="CountrySqlDataSource"           SelectCommand="SELECT DISTINCT location FROM tlbEmployee"          EnableCaching="True"          CacheDuration="60"          ConnectionString="<%$ ConnectionStrings:ConnectionString %>"          RunAt="server" />         <asp:SqlDataSource ID="EmployeeDetailsSqlDataSource"           SelectCommand="SELECT * FROM [tlbEmployee] WHERE (([location] LIKE '%' + @location + '%') AND ([jobSkills] LIKE '%' + @jobSkills + '%'))"          EnableCaching="True"          CacheDuration="60"          ConnectionString="<%$ ConnectionStrings:ConnectionString %>"          FilterExpression="location LIKE '{0}' AND jobSkills LIKE '{1}'"          RunAt="server">           <FilterParameters>            <asp:ControlParameter ControlID="CountryListBox"   PropertyName="SelectedValue" />            <asp:ControlParameter ControlID="LastNameTextBox" PropertyName="Text" />          </FilterParameters>            <SelectParameters>                <asp:ControlParameter ControlID="CountryListBox" Name="location" PropertyName="SelectedValue"                    Type="String" />                <asp:ControlParameter ControlID="LastNameTextBox" Name="jobSkills" PropertyName="Text"                    Type="String" />            </SelectParameters>        </asp:SqlDataSource>        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"            SelectCommand="SELECT DISTINCT location FROM tlbEmployee"></asp:SqlDataSource>        </div>        <asp:SqlDataSource ID="SqlDataSource2" runat="server"></asp:SqlDataSource>    </form></body></html> 

View 1 Replies View Related

Get Data From SqlDataSource For Selected Row

Feb 24, 2007

Hello all! How can I get data from SqlDataSource for row selected in GridView?

View 3 Replies View Related

How To Access Data Using SqlDataSource

Aug 27, 2007

Hello all,I have what I think should be a simple problem to solve but I just don't quite understand what to do (.NET Framework Developer Center confused me :( ).My code should load the highest SiteID, known as Last_ID into the siteIdBox when the form is in insert mode.  My difficulty is in understanding how to use the sqlDataSource correctly.  Dim dsLastId As New SqlDataSource() Dim siteIdBox As TextBox Dim dsmLastId As SqlDataSourceMode If FV_Site.CurrentMode = FormViewMode.Insert Then Try
dsLastId.ConnectionString = ConfigurationManager.ConnectionStrings("AquaConnectionString1").ToString dsLastId.SelectCommandType = SqlDataSourceCommandType.Text dsLastId.SelectCommand = "SELECT MAX(Site_ID) AS Last_ID FROM Tbl_Site"

dsmLastId = SqlDataSourceMode.DataReader

siteIdBox.Text = dsmLastId.?????

Finally
dsLastId = Nothing End Try End If  If anyone could tell me the code for getting the value from the select statement into the textbox, I would be most grateful.Thank you, m00sie. 

View 4 Replies View Related

InsertCommand Using Data From A Second SqlDataSource - ASP.NET 2.0

Nov 29, 2007

I have a process that inserts a new record using the InsertCommand of a SqlDataSource.  As part of the process, I need to insert data the is available in a different SqlDataSource.  I was trying this with the Insert Parameter:

View 1 Replies View Related

Retrieve Data From SQLDataSource

Jan 23, 2008

Background:I am using Visual Studio 2005 Standard SP1 to create an ASP.NET website that accesses an SQL 2005 database.  I am using vb.net as well.I am passing an ID in a query string from one page to the next, where I retrieve it using an SQLDataSource.  The data will only be one row; it is returning customer information.Problem:I need to be able to get specific fields from the SQLDataSource and populate some textboxes.  Honestly, I'm not really sure where to begin.  For the sake of argument, let's say that I am working with this:'My TextboxDim LastName As Textbox'My SQLDataSource (filtered by query string using the customer's ID to only get 1 customer's information at a time)SQLDataQuestion:So, how would I go about retrieving the lastname field from SQLData and inserting it into the textbox LastName?Thanks,    J'Tok

View 2 Replies View Related

How To Get Data Based On Value Of Another Sqldatasource

Feb 17, 2008

1st of all i'm using 3.5 and c#.
 On my page I have 2 sqldatasource controls. sds1 and sds2
 In my select statement of sds2 how do I make a select parameter based on a value or column I return from sds1? And please don't tell me to join my sds2 select in sds1, I don't want to do that. I need two seperate sds.

View 4 Replies View Related

Caching Data With SqlDataSource

Mar 14, 2008

Hello, every one! This is my first post on the forum. I got some questions about caching data with SqlDataSource controls in asp.net 2005. Here are them:    According to the vs.net 2005 documents, SqlDataSource controls will sustain an individual cache for each combination of ConnectionString, SelectCommand and values of SelectParameters. But how about FilterExpression and FilterParameters? If I enable caching and change the FilterExpression or values of FilterParameters, will the SelectCommand be reexcuted, or will the databinding controls just get data from the existing cache? And will multiple SqlDataSource controls with the same combination of ConnectionString, SelectCommand and values of SelectParameters share a common cache, or sustain caches of their own?

View 1 Replies View Related

Accessing Data From The SQLDataSource.

Apr 5, 2008

I am using a drap and drop SQLDataSource control.  Everything works like I am wanting it to, but I want to check a value from one of the fields that I have retrieved.  I am lost as how to retreive just the field.  If I have to create another dataset to do the work what is the point of using the drag and drop control?  I would really like to just access the dataset fields as needed.

View 2 Replies View Related

How Get Data From SqlDataSource Into CodeBehind?

Apr 6, 2008

Hello...Can someone help me?I´m getting info of a product via sqldatasource in this way:<asp:SqlDataSource ID="myData" runat="server" ConnectionString="..." SelectCommand="spGetProduct" SelectCommandType="StoredProcedure">                       <SelectParameters>      <asp:QueryStringParameter Name="Id" QueryStringField="Id" Type="String" />   </SelectParameters></asp:SqlDataSource>In my ASPX page I get the data in this way:<asp:Repeater ID="repProduct" runat="server" DataSourceID="myData">   <ItemTemplate>      <p><%# Eval ( "ProductName") %></p>   </ItemTemplate></asp:Repeater> My problem is in my code behind because I need some data from this DataSource.For example, I want the Product Name as the page title. So the question is how I get something like this in my code behind:protected void Page_Load ( object sender, EventArgs e ){    this.Page.Title = Eval ( "ProductName") ;}Thanks! 

View 2 Replies View Related

Can I Get Data From Sqldatasource With Codebehind?

Apr 13, 2008

Hi, I don't know if i's a silly question.
Now I want to get data from sqldatasource by only write some code,I don't know without creat some data control components if it can be true?
If it can do,how can I write the codes?
Especially I don't know how to write the code witch can "read" data.

View 3 Replies View Related

Filtered Data And SQLDatasource

Apr 21, 2008

In asp.net 3.5.....
To get the number of rows returned when the select is executed.......
 Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Selected        Session("MessageText") = e.AffectedRows & " Profile(s)"End Sub
How do you get the number of rows returned when you apply a filter expression to a selection of rows?
Thanks
Craig

View 3 Replies View Related

Fetch Data From Sqldatasource

Jun 4, 2008

hi,im just a newbie in asp.net.i have my sqldatasource and a label. i want to get the data from sqldatasource to the label. how can i do that.need codes 

View 2 Replies View Related







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