SelectCommand Multi Text Boxes

Nov 7, 2007

I would like a form that has 3 text boxes. These 3 boxes are going to be used for entering search criteria. The first box is for searching a field called CasePK. The second is for searching a field called LinePK and the third is for searching a field called DOS. DOS is a date field. The other two are text fields.

I am using a SQLDATASOURCE and a Gridview. What will the SelectCommand look like so that I can search the 3 fields using the data from the textboxes?

View 1 Replies


ADVERTISEMENT

Slowness On Multi Processor Boxes.

Aug 16, 2006

SQL2K
SP4

Howdy all. I have a query with bizarre results in Query Analyzer.

Box1; 4 x 3.0 processors, 4 gigs of RAM. Results never come back.
Box2; 8 x 3.0 processors, 16 gigs of RAM. Results never come back.

Both of the above boxes are extremely under utilized. The absolute max amount of CPU being used is 25%. Box1 had 1 gig free RAM and Box2 had 7 gigs free RAM.

Box3; 1 x 3.0 processor, 1 gig of RAM. Results in 15 seconds.
Box4, all the same as box 3.

I took a backup of the DB and restored it from box to box to box, so I know everything is identical.

I once had a deadlock issue where I had to use the maxDop hint and tried that here, but it didn't help.

All ideas are appreciated.

TIA, cfr

View 1 Replies View Related

Text Boxes

Jan 29, 2008

Hi,
I am doing a report in which i have to create Wall chart kind of layout and for that i have to place Text Boxes on the
report at run time.Now In my Layout i have some Text Boxes which are going Out of the page(Starts from page 1 and Ending on page 2)but when i am looking my report in the Print Preview the Report Viewer is shifting the entire Text Box to Page 2. Can i do something to print the report as they are seen in the Normal layout.

Can any one help me out with this.......
Amit

View 6 Replies View Related

Concatenating 2 Text Boxes

Feb 13, 2006

Hi,

How do we concate a normal text with an underlined text?

eg: I would like to concate :

textbox1 = my email address:

and

textbox2 = xxx@hotmail.com

into a new textbox3.

expected result: textbox3 : my email address:xxx@hotmail.com

Really appreciate your help.

Thanks

View 4 Replies View Related

Problems With Null Text Boxes When Doing Like Search

Apr 10, 2007

I have three text boxes firstname, lastname, dob.  It is set up to do a like search on the the text boxes.  If a user wants to do a search for just the last name it will not work.  You must type in something in all three boexes.  Doesn't anybody know how to correct  this.  Here is the code.   Thanks.
 
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
GridView1.Visible = False
GridView2.Visible = False
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
GridView1.DataSourceID = "SqlDataSource1"
GridView1.DataBind()
GridView2.DataSourceID = Nothing
GridView2.DataBind()
GridView1.Visible = True
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
GridView2.DataSourceID = "SqlDataSource2"
GridView2.DataBind()
GridView1.DataSourceID = Nothing
GridView1.DataBind()
GridView2.Visible = True
End Sub
 
Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Meditech Radiology Numbers</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="master_headertop"><asp:HyperLink ID="HomePageLink" runat="server" ImageUrl="~/images/headertop_img.jpg" /></div>
 
<div id="master_menu">
<div class="sidebar">
<div class="sidebarheader">
Demographic search</div>
<div id="master_sidebarSamples" class="sidebarcontent">
&nbsp;
<table>
<tr>
<td style="width: 100px">
<asp:Label ID="Label1" runat="server" Text="First"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px; height: 26px;">
<asp:Label ID="Label2" runat="server" Text="Last"></asp:Label></td>
<td style="width: 100px; height: 26px;">
<asp:TextBox ID="LastName" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
<asp:Label ID="Label3" runat="server" Text="DOB"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="DOB" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
<asp:Button ID="Button1" runat="server" Text="Search" /></td>
</tr>
</table>
</div>
</div>
<div class="sidebar">
<div class="sidebarheader">
Search by Mr#</div>
<div id="master_sidebarWalkthroughs" class="sidebarcontent">
&nbsp;
&nbsp;<table>
<tr>
<td style="width: 100px">
<asp:Label ID="Label5" runat="server" Text="MR #"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="MR" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
<asp:Button ID="Button2" runat="server" Text="Search" /></td>
</tr>
</table>
</div>
</div>
&nbsp;<br />
&nbsp; &nbsp; &nbsp;
</div>
<div id="master_content" style="height: 399px">
 
&nbsp;
&nbsp;&nbsp;&nbsp;<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="LAST" HeaderText="LAST" SortExpression="LAST" />
<asp:BoundField DataField="FIRST" HeaderText="FIRST" SortExpression="FIRST" />
<asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
<asp:BoundField DataField="RAD #" HeaderText="RAD #" SortExpression="RAD #" />
<asp:BoundField DataField="MR#" HeaderText="MR#" SortExpression="MR#" />
<asp:BoundField DataField="EXAM#" HeaderText="EXAM#" SortExpression="EXAM#" />
<asp:BoundField DataField="EXAM DATE" HeaderText="EXAM DATE" SortExpression="EXAM DATE" />
<asp:BoundField DataField="EXAM NAME" HeaderText="EXAM NAME" SortExpression="EXAM NAME" />
<asp:BoundField DataField="ORDER DOC" HeaderText="ORDER DOC" SortExpression="ORDER DOC" />
<asp:BoundField DataField="Column 9" HeaderText="Column 9" SortExpression="Column 9" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RADConnectionString2 %>"
SelectCommand="SELECT * FROM [Full File through 2006] WHERE (([FIRST] LIKE '%' + @FIRST + '%') AND ([LAST] LIKE '%' + @LAST + '%') AND ([DOB] LIKE '%' + @DOB + '%'))" OnSelecting="SqlDataSource1_Selecting">
<SelectParameters>
<asp:ControlParameter ControlID="FirstName" DefaultValue=" " Name="FIRST" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="LastName" DefaultValue=" " Name="LAST" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="DOB" DefaultValue=" " Name="DOB" PropertyName="Text"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2">
<Columns>
<asp:BoundField DataField="LAST" HeaderText="LAST" SortExpression="LAST" />
<asp:BoundField DataField="FIRST" HeaderText="FIRST" SortExpression="FIRST" />
<asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
<asp:BoundField DataField="RAD #" HeaderText="RAD #" SortExpression="RAD #" />
<asp:BoundField DataField="MR#" HeaderText="MR#" SortExpression="MR#" />
<asp:BoundField DataField="EXAM#" HeaderText="EXAM#" SortExpression="EXAM#" />
<asp:BoundField DataField="EXAM DATE" HeaderText="EXAM DATE" SortExpression="EXAM DATE" />
<asp:BoundField DataField="EXAM NAME" HeaderText="EXAM NAME" SortExpression="EXAM NAME" />
<asp:BoundField DataField="ORDER DOC" HeaderText="ORDER DOC" SortExpression="ORDER DOC" />
<asp:BoundField DataField="Column 9" HeaderText="Column 9" SortExpression="Column 9" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:RADConnectionString3 %>"
SelectCommand="SELECT * FROM [Full File through 2006] WHERE ([MR#] = @column1)">
<SelectParameters>
<asp:ControlParameter ControlID="MR" Name="column1" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
<br />
<br />
&nbsp; &nbsp;
 
</form>
</body>
</html>

View 18 Replies View Related

Of Multiple Parameters, SqlDataSource And Text Boxes

Feb 12, 2006

Hi,Hope if someone can help me here. Keep in mind I an fairly new to .NET and SQL and am learning to break my MS Access habit :)
I have a web form that is using a SqlDataSource and a FormView control. In addition to this I have 2 text boxes. What I am trying to do is display results in the FormView based on what a user types into one of the Text Boxes (one or the other…Not both)
 
The SELECT statement in the SqlDataSource looks like this in concept.
SELECT Field1, Field2, Field3, Field4FROM dbo.MYTABLEWHERE (Field1 = @Field1) AND (Field2 IS NULL)OR  (Field2 = @Field2) AND (Field1 IS NULL)
 
I have the two text boxes pointing at the parameters (@Field1 and @Field2) so in theory I would expect that when a user populates one of the text boxes and clicks a button to databind the FormView it would display a record matching that criteria…. But it’s not all I get is a blank/missing FormView.
I tried different variations on the SQL statement and tried using  = ''  instead of IS NULL but still the same results. However, if I populate one text box with a value that I know is not in my table and populate the other with a value of which I know exists in my table is…It works.What am I missing?
 

View 13 Replies View Related

Toggling Visibility Between Two Text Boxes In Ssrs

Oct 9, 2012

how visibility can be toggled between two textboxes in ssrs? For example if textbox1 is visible and textbox2 is hidden initially and textbox2 should be visible when clicked on textbox1 and textbox1 should go invisible when textbox2 is shown... and then again when clicked on textbox2, textbox1 should be visible and textbox2 should go invisible.In a short, it is like switching visibility between 2 textboxes... A click on first textbox should display the second textbox and another click on second text box should display first text box.I cannot provide parameter as it is not there in the requirement. how to toggle the text within a single text box to fulfill above requirement...

View 1 Replies View Related

Allowing For Blank Fields In Date Text Boxes

Jun 27, 2005

Several textboxes are being on a web form for date entry. and we want to allow the user to leave date fields blank (if particular date is unknown).  However, when the field is left blank, the SQL Server 2000 database defaults to 1/1/1900 (datatype = datetime).My question is as follows:  How is it possible to leave a date textbox field blank, and either send 000000 or spaces to the SQL Server 2000 database datetime field?Any advice/insight is appreciated!  Rob

View 2 Replies View Related

How To Link Combo Boxes And A Text Box In A Datagrid View?

Mar 11, 2008

Hi folk..
can some body help me with this problem..???

I have a grid view on a form which has got colums which are set as data combo boxes. and a third column whish is set to a text box. all the 3 controls on the datagrid view are bound with sql server table.
they are asociated with two saparate tables within 1 database...
now what i want is that the user of the application can select either combo box 1 of teh 2nd combo box.
and automatically the syncronize and also the text column asociates with related data..

for example

Country City Pincode
India vasco 403802

now while flling the grid vew.. the user can select either country or city.. automatically
both syncronize with related data and so does the text box.


plz help me with the code.. as well..


thanks a million

View 1 Replies View Related

Reporting Services :: Dynamic Positioning Of Text Boxes In SSRS

Sep 30, 2015

I have a user table with Label and value fields where i would like to control the display of the text boxes based on the values selected in my user table.Can we adjust the text box positions dynamically based on the user table values.

Ex: Table

Label1 Field1 Label2  Field2  Label3 Field3
ID       100                           Dept   Sales

Report Design :

Label1: ID    Field1:100
Label2:          Field2:
Label3:Dept   Field3:Sales

Expected Result :

Label1: ID    Field1:100
Label3:Dept   Field3:Sales

In my table i don't have values for Label 2 & Field 2 , can we adjust the spacing conditionally to be utilized by Label3 & Field3 in SSRS.

Note : Above mentioned data is just for an example and in my actual report i can have more than 3 columns and report is looking ugly with all the spacing if i don't have data in all the fields.

View 9 Replies View Related

Getting Value From Multi-Line Text Box

Sep 28, 2004

Hi,
I have a Multiline Textbox in my application.The value from the textbox is updates in a SQL
table.The problem i have is
If I type in the textbox 1211 London street Sussex <br> UK <br>Europe ,only 1211 London street Sussex gets into the table.Anything I type after the "Enter " doesnot go into the table.

I checked the field sizes in my stored procedure and they are varchar(500) .

Any ideas

View 4 Replies View Related

Multi Format Text File

Apr 5, 2007

Hello. I am in the process of migrating an old app to SQL Server. The old app reads hundreds of different flat file formats. One of the more complex ones is a multi-format delimited file. For example:

01^Bob Johnson^123 Main St^Anytown^St
02^Book1^$20
02^Book2^$30
03^Gift Cert^Happy Birthday^$100

This file is delimited with the ^ character. Note that the first 2 characters identify the row type. All 01 rows have data in the format: Name, Street Address, City, State. All 02 have data in the format: Book name, price. Etc.

Any clever ideas on how to parse this? I tried setting it up as a flat file source with the ^ delimiter. It doesn't work - in this example it wraps the third row to the end of the second row and keeps adding columns to fill out the row.

The only option that I can think of is to pull the entire row into one long column, and then use a script component to manually substring each column out.

Any help would be greatly appreciated.

Thanks,
Chris

View 7 Replies View Related

Import Multi-Row Record Text File With DTS

Apr 9, 2004

I have a text file I need to import into a SQL Server table. Each record spans several lines. Does anyone have a vbscript routine that wil go thru this text file and put each record on one row? Once the records are one row, DTS will easily handle the import. Or is there a better way?

Sample multi-row records:

WRLDWYXCDS1 ALT101 APR04 21:30:24 6879 FAIL ALT
HOST 00 0 08 00 DN 3073477171 1st CYCLE
TEST TYPE CKTTST DIAGNOSTIC RESULT BIC/EBS LC TRBL:PTRN 000E S= 1 R= 0
ACTION REQUIRED Replace Card CARD TYPE 6X21AC

WRLDWYXCDS1 ALT101 APR04 22:31:37 7672 FAIL ALT
HOST 00 0 08 00 DN 3073477171 1st CYCLE
TEST TYPE CKTTST DIAGNOSTIC RESULT BIC/EBS LC TRBL:PTRN 000E S= 1 R= 0
ACTION REQUIRED Replace Card CARD TYPE 6X21AC

View 3 Replies View Related

Multi-formatted Text In A Single Texbox

Apr 24, 2007

The latest similar question is almost a year old and hasn't been definitively answered. I'm designing a certificate type report where the declaration text uses static and dynamic text generated in an expression for the textbox. The problem is that there doesn't seem to be an obvious way of formating sections of the text expression with different font sizes, weights and attributes to depict the effect desired. E.g. I want one textbox to say:



This Certifies that {a field value} was blah blah blah by {another field value} etc.



Can this be done in a regular textbox? If not, are there any work-arounds to accomplish the same effect. BTW, I'm working in RS 2005 flavor with VS 2005 Report Designer.



Thanks in advance for your help.

View 4 Replies View Related

How To Display The Selected Multi-value Report Parameter/s In A Text Box?

Mar 19, 2008



Hi All,

I have a report parameter which i multivalue. I want to display the selected value in a text box. I have written the following code :


=Switch(Parameters!ServiceAttribute.Count = 1,Parameters!ServiceAttribute.Value(0),

Parameters!ServiceAttribute.Count = 2,(Parameters!ServiceAttribute.Value(0) & ", " & Parameters!ServiceAttribute.Value(1)))



Which suggests that if only one of the two multivalue parameter id is selected display the same (Parameters!ServiceAttribute.Value(0)).

This works fine when i select both the attributes but throws an exception "Index was outside the bounds of the array" when i select only one of the parameters. Can anyone help me with that?

Also i want this report parameter to allow null i.e. if a user does not select anything he should still be able to view the report.
In case of regular dropdowns i have added a <Null> value to the existing values and set the default to null. But in case of multi-value, it does not give an option of adding <Null>

View 5 Replies View Related

Parameter Boxes

Feb 4, 2007

hey there

Is there a way to reduce the parameter box size.

I am using a date/time picker so want that to be the prominent part for the user?

at the moment it shows like this

StartDate (inputbox) date/time picker

if that inputbox could either be greyed out or smaller?



cheers

jewel

View 3 Replies View Related

Check Boxes Repeating

Apr 24, 2008

I have a store procedure that pulls info for a meeting coming up. They can choose their meal choice which in this case is fish, chicken, beef. What is happening on the report, it's listing each person 3 times with each choice no matter which is was. How do I correct this? Code below:
 
CREATE PROCEDURE [dbo].[spGetCourseEmailList1]( @Code1 char(9)) AS SELECT DISTINCT               dbo.[names].lname as LastName,  dbo.[names].fname as FirstName,             dbo.[evser].ses as MealChoice,             dbo.[evldg].paid as AmountPaid, dbo.[names].gp as PreferredAddress,  dbo.[names].mi as MiddleInitial,  dbo.[names].nname as NickName,  dbo.[names].xname as Suffix,  dbo.[names].hphone as HomePhone,  dbo.[names].email as EmailAddress,  dbo.[names].addr1 as HomeAddress1,  dbo.[names].addr2 as HomeAddress2,  dbo.[names].city as City,  dbo.[names].st as State,  dbo.[names].zip as ZipCode,  dbo.[firms].fname1 as FirmName1,  dbo.[firms].fname2 as FirmName2,  dbo.[firms].faddr1 as FirmAddress1,  dbo.[firms].faddr2 as FirmAddress2,  dbo.[firms].fcity as FirmCity,  dbo.[firms].fst as FirmState,  dbo.[firms].fzip as FirmZip,  dbo.[firms].fphone as FirmPhone,  dbo.[names].udflist1 FROM dbo.[firms] INNER JOIN dbo.[names] ON dbo.[firms].firm = dbo.[names].firm
INNER JOIN dbo.evldgON dbo.[names].id = dbo.[evldg].id
INNER JOIN  dbo.evregON dbo.[evldg].id = dbo.[evreg].id
INNER JOIN dbo.evserON dbo.[evreg].code1 = dbo.[evser].code1
WHERE dbo.[evldg].code1 = @Code1 AND  dbo.[evreg].code1 = @Code1 AND dbo.[names].xwebflag <> 'Y'ORDER BY dbo.[names].lname, dbo.[names].fnameGO
 
 
THANKS!!!

View 7 Replies View Related

Transfer Passwords Between Boxes

Nov 10, 2001

Wondering on how to script over the passwords from one 2000 box to another. We are cutting a box over from dev to production and need to copy userids and passwords from another box.

Any suggestions?

Thanks,

Steve

View 1 Replies View Related

SELECT Empty Boxes?

Jan 30, 2001

I need to do a select on a table for all empty items in a column. What is the syntax for selecting the empty (NULL)?

View 3 Replies View Related

Cascade Combo Boxes

Nov 2, 2006

I follow sql coding for cascading combo boxes that populates them
if the first one populates the cdname the second one should populate the cd group and the third one the composers with the songs or the samthing with music hymnals. I am trying the steps they aren't populating. Where are simple books on this?

mikevds@optonline.net

View 1 Replies View Related

Updating Combo Boxes

Aug 7, 2006

Hi, i have created a database in VB05, i have a form and a few combo boxes. I am a total newbie to this so i only know the total basics.

two tables i have are Ratings and films.

Ratings:
RatingID
Rating

Films:
filmID
Title
ratingID

above are the columns of my tables.

what i am trying to do is select a rating on the first combo box which will then only show the titles with that rating in the next combo box.

I have the whole database created, i have the relationships in place and the combo boxes are all connected to the datasources etc. The comboboxes are currently filled with data by the default sql query which is created. But it is showing the whole data for each when i only want to show the film titles for what rating is selected.

Could any one please help.

View 2 Replies View Related

Drop Down Boxes For Dates

Jun 27, 2007

I have created several reports using sql server that have the end user enter a start and end date to run the query. I was just wondering if there was a way to just have a drop down/combo type box instead so the user could just pick the date instead of having to type one in.

View 5 Replies View Related

Is It Possible To Use Dependent Combo Boxes?

Nov 15, 2007



Hi,

I have a problem with a report.


in this report 1 use 2 combo boxes. The first with my organisation on different levels.

And in the second a value for every level and all.

Now i want to filter the organisation box with the second combo box.

For the first time it works but if i change after that the box it doesn't work.

I use SQL Reporting Services 2005

View 4 Replies View Related

Rebooting Cluster Boxes

May 4, 2007

Hi

I am a 2 node active/passive 2003 cluster. I have some maintenace where I need to shut down both of the servers at the same time.

Has anyone experience any issue in this approach?

I am planning to take the cluster offline and then shutdown the servers and bring it online after the reboot. I am also running SQL so any concerns or tips as what would be the best scenario.

Hoping to get some reply.

Thanks
Anup

View 1 Replies View Related

Parameter Boxes Are Empty

Jan 5, 2007

Hi,

I am have a reporting server which connects to a analysis server which connects to a sql server and a db2 server. I am using windows integrated security all the time except for the DB2 connection. That is a fixed username/password.

Reporting server (RS), analysis server (AS) and sql server are all on the same machine.

I created a local group and added the correct users to it.
I gave that group browse rights on the reports so that works correctly.

I created a role in AS and added that group to that role. Gave all read rights to that role.

I created a login for that group on the SQL server and gave that group db_datareader role.

When I connect as an administrator every reports runs fine.

When the test user connects they can browse the reports but the drop down boxes for the parameters are empty.

What goes wrong ?

With regards,

Constantijn Enders

View 3 Replies View Related

Square Boxes Getting Inserted In Table

Apr 11, 2007

hi ,
       In my database I have table with column of datatype nvarchar in which I am writing the address of users.Now address field in aspx page is multiline because of which my address contains characters and
. These special characters are getting inserted in database as square boxes. Is their any way to avoid it. Also the constraint is that I don't want to replace or
by space before writing contents to database.
       Please write to me any solutions u are having.
thanks in advance.
Thanks and regards,
Nita Jadhav.       
 

View 1 Replies View Related

How To Add Additional Functionality To Parameter Boxes

May 18, 2006

Is there a way to add additional functionality to the report parameter boxes?

For example, when a user enters an invalid choice into a report parameter box, I want a popup balloon that tells them to try again.

I know how to do this for a regular Winform combobox, but can I implement an interface to override the default behavior of the report parameter boxes?

View 5 Replies View Related

HTML Rendering For Lines On Boxes

Aug 7, 2007

I need to create forms for my users containing boxes and lines. When I get the boxes/lines looking correctly for PDF printing, they look really whacked out in HTML view. I understand this is caused by overlapping objects (lines on top of boxes, etc.) I tried a test to see if I could use all lines. This is VERY difficult to get aligned correctly for HTML view. Once I got my test completed, the HTML looked ok -- not great, but the PDF rendering looked REALLY bad.

Is there a way to overlap objects and tell the package to 'group' all the objects as one (like in Word) for HTML rendering? I need to put a karge rectangular box with lines and textboxes on top of it.

Any suggestions are appreciated.
Thanks

View 3 Replies View Related

If Then In A SelectCommand

May 12, 2007

Hi all,
I want to do something like this, but I cannot get it working:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AFS_WAWI_DBConnectionString1 %>"<%If Session("my") = "123" thenSelectCommand="SELECT [nr1] FROM [Artikel]"ElseSelectCommand="SELECT [nr2] FROM [Artikel]"End if %></asp:SqlDataSource>
 Is that possible and how can I manage that?
Thanks for your answers, Chris.

View 4 Replies View Related

RUN SQL 2005 SSIS Package On SQL 2000 BOXES?

Aug 22, 2006

I have a package designed and working correctly for months now. My challenge now is to run this package on a box that does not have SQL 2005 SSIS install. It has SQL 2000 installed.

My question is - Can I compile the SSIS into EXE or any other kind of DTS package to run on a none-SQL 2005 box?


Thanks!

--Jon

View 1 Replies View Related

SelectCommand Problem

Dec 7, 2006

for some reason the following code fails. I want to present all of the information of the CD (from table B)that inlcudes the song name the user types in the text box(table A).
Meaning the user types the name, it's located in table A, for each CD id in table A I want to present all the info from table B. Do I have to use DataRelation?:
private void Button1_Click(object sender, System.EventArgs e)
{
System.Data.SqlClient.SqlDataAdapter da=new SqlDataAdapter();
string str=TextBox1.Text;
 
System.Data.SqlClient.SqlParameter sparam=new SqlParameter("@song",SqlDbType.NVarChar);
sparam.Direction=ParameterDirection.Input;
sparam.Value=str;
da.SelectCommand=new SqlCommand();
da.SelectCommand.Connection=sqlConnection1;
da.SelectCommand.CommandText="CdInfoSP";
da.SelectCommand.CommandType=CommandType.StoredProcedure;
da.SelectCommand.Parameters.Add(sparam);
 
da.Fill(dataSet11,"CdInfoSP");
 
DataGrid1.DataSource=dataSet11;
 
DataGrid1.DataBind();
DataGrid1.Visible=true;
 
 
}
 
My Stored procedure is:
CREATE PROCEDURE dbo.CdInfoSP  (@song nvarchar)AS select cd_id,cd_name,year from song_cd_artist,cd_info where song_name like '%@song%' and cdofsong_id=cd_idGO
 
I hope someone can help me!
Thanks in advance!

View 1 Replies View Related

Sqldatasource.selectcommand?

Apr 27, 2007

Hello everyone,
I would like to know if there is a way to know if a sqldatasource.selectcommand returns tables or not? I'm trying to make a If statement so that if the selectcommand isn't returning anything it will disable a checkbox.
 
Thank you.

View 2 Replies View Related

Custom SelectCommand

Jun 19, 2007

 If I hard code the select statement everything works fine.
<asp:SqlDataSource ID="SqlDataSourceZip" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
SelectCommand="SELECT * FROM [Station] WHERE ([ZipCode] = '80523' OR [ZipCode] = '80521' OR [ZipCode] = '80553' OR [ZipCode] = '80522' OR [ZipCode] = '80526' OR [ZipCode] = '80527' OR [ZipCode] = '80525' OR [ZipCode] = '80524' OR [ZipCode] = '80547' OR [ZipCode] = '80535' OR [ZipCode] = '80538' OR [ZipCode] = '80551' OR [ZipCode] = '80549' OR [ZipCode] = '80550' OR [ZipCode] = '80546' OR [ZipCode] = '80539' OR [ZipCode] = '80512' OR [ZipCode] = '80537' OR [ZipCode] = '80541' OR [ZipCode] = '80650' OR [ZipCode] = '80515' OR [ZipCode] = '80513' OR [ZipCode] = '80610' OR [ZipCode] = '80534' OR [ZipCode] = '80536' OR [ZipCode] = '80634' OR [ZipCode] = '80543' OR [ZipCode] = '80532' OR [ZipCode] = '80638' OR [ZipCode] = '80615' OR [ZipCode] = '80646' OR [ZipCode] = '80648' OR [ZipCode] = '80612' OR [ZipCode] = '80631' OR [ZipCode] = '80528')"> </asp:SqlDataSource>
 Want to use a label control to return data, but can't find anything that works.
<asp:Label ID="zipLabel" runat="server"></asp:Label>
[ZipCode] = '80523' OR [ZipCode] = '80521' OR [ZipCode] = '80553' OR [ZipCode] = '80522' OR [ZipCode] = '80526' OR [ZipCode] = '80527' OR [ZipCode] = '80525' OR [ZipCode] = '80524' OR [ZipCode] = '80547' OR [ZipCode] = '80535' OR [ZipCode] = '80538' OR [ZipCode] = '80551' OR [ZipCode] = '80549' OR [ZipCode] = '80550' OR [ZipCode] = '80546' OR [ZipCode] = '80539' OR [ZipCode] = '80512' OR [ZipCode] = '80537' OR [ZipCode] = '80541' OR [ZipCode] = '80650' OR [ZipCode] = '80515' OR [ZipCode] = '80513' OR [ZipCode] = '80610' OR [ZipCode] = '80534' OR [ZipCode] = '80536' OR [ZipCode] = '80634' OR [ZipCode] = '80543' OR [ZipCode] = '80532' OR [ZipCode] = '80638' OR [ZipCode] = '80615' OR [ZipCode] = '80646' OR [ZipCode] = '80648' OR [ZipCode] = '80612' OR [ZipCode] = '80631' OR [ZipCode] = '80528'
something like this, but it don't work.
SelectCommand="SELECT * FROM [Station] WHERE (<%=zipLabel.Text%>)"> </asp:SqlDataSource>

View 3 Replies View Related







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