Configuring Dynamically An SqlDataSource

Jan 4, 2008

I have several Sql Tables, each containing more than 100 fields, on which I need to perform display operation through GridView, Insert and Update through an array of dynamically created and databound TextBoxes.

I would like to use a single page to manage all Sql Tables on the basis of the name of the specific one invoked by the user.

In order to achieve that, I need to  dynamically configure the SqlDataSource Web Control present on the page for each Sql Table. In particular I need to generate at runtime the InsertCommand and the UpdateCommand.

On how to do it I have no idea.

Federico

View 2 Replies


ADVERTISEMENT

Configuring Dataset Dynamically

Apr 16, 2007

HI ,



I am using SQL Server 2005 Reporting Services. I have many parameters to pass to the dataset. Is there a way to change the dataset dynamically based on the parameters selected?



Suppose If param1 is selected, I want to use dataset1 and if param 2 is selected. I want to use dataset2 and so on... in my reports.



Any help is greately appreicated!



Thanks in advance!

View 8 Replies View Related

Dynamically Configuring Fuzzy Grouping

Jun 7, 2007

Hello,



I have been struggling with this for quite awhile so any help would be appreciated.



I need to know if there is away to populate the fuzzy grouping control dynamically. I know you programmatically design a package and customize it in C# but for our purposes we would like to control the SSIS package via database settings. When the settings change the package would then act different. Its a simple a package consisting of an Input - fuzzy grouping - conditional split - output. The connections are setup dynamically using parameters, expressions and a script task. Is there anyway I could do a similar thing for Fuzzy Grouping?

View 13 Replies View Related

Configuring The Connection (DataSource) Dynamically

Feb 6, 2008



Hi All,
I need to write a report which will run based on the user's input for Server Group. Meaning, if the user wants the report to be run for one say, UAT group, the report (and therefore the stored procedure) should be executed against UAT server. Or, if the user wants it to be run on the Production machine, the stored procedure should be executed on the Production Server. Assume that both UAT and Production servers are in the same domain to rule out any authentication issue.

I think one way of doing it is to create a linked server on one server which we use to connect via the Report Manager. So, whatever Server Group is selected based on that the SP will be executed on that respective Server Group's Server, since in the query we will have given full names of the tables that we use.

But, I strongly suspect, that having linked servers will not be accepted since it requires that the server owners maintain that. So, I was thinking if there is any other way of achieving this. If anyone knows, please help me with this.

Thanks a lot and let me know if the question is not clearly stated.

Manoj.

View 1 Replies View Related

Configuring SqlDataSource At Runtime

Oct 31, 2007

In a web site the user has to choose one out of several sql tables to deal with.
He will then be allowed to view the selected table data through a GridView, to insert a new row into and to update a row in the selected table by means of an array of TextBoxes created dynamically on the base of the selected table.
I think it is possible to solve the problem fully by properly configuring at run time an SqlDataSource.
I have solved the issue of data display by declaring in the code behind within the OnPageLoad sub the following:
SqlDataSource1.SelectCommand = "Select * FROM " & selectedTable
While for the  GridView1 I have added the selected table columns to the columns collection as follows:
for i=0 to ColumnCount-1 Dim cac As BoundField = New BoundField
cac.HeaderText = HeaderNamesArray(i)
cac.DataField = ProductNamesArray(i)Me.GridView1.Columns.Add(cac)
next
I have difficulty on how to do similar declarations for the insertcommand and update command.

View 2 Replies View Related

Configuring A SQLDatasource Control

Feb 26, 2006

When I configure a SQLDataSource control I want the following where clause...
WHERE     (RegionID = @RegionID AND DistrictID IS NULL AND CampusID IS NULL) OR (DistrictID = @DistrictID AND CampusID IS NULL ) OR(CampusID = @CampusID AND UserRole = 'CampusAdmin') OR (CampusID = @CampusID)but it gets reformated as....
WHERE     (RegionID = 'Region10') AND (DistrictID IS NULL) AND (CampusID IS NULL) OR                      (DistrictID = 2) AND (CampusID IS NULL) OR (CampusID = '999999103') AND (UserRole = 'CampusAdmin') OR                       (CampusID = '999999103')I don't think these are functionaly equivelant, are they?If not how do I stop the 'wizard' from reformatting the SQL where clause?Thanks

View 3 Replies View Related

Configuring SQLDataSource With Default Database

Oct 23, 2007

Hello,
I have specified a default database in my web.config like this:
<dataConfiguration defaultDatabase="scsLocal"/>
<connectionStrings>     <add name="scsLocal" connectionString="server=DRLSWARTEBRV;database=SCS;uid=******;password=******;" providerName="System.Data.SqlClient"/>
</connectionStrings>
Now I would like to configure a SQLDataSource control to use this default database, yet it prompts me for a connectionstring. I know I can program it in the code behind file (if I ommit connection string, it will use the default), but then I can make no use of the wizard for configuring the SQLDataSource which would safe me a lot of coding.
 Is there a way to configure the SQLDataSource to use the default database that is specified in the web.config?
 Thanks!
Veerle

View 1 Replies View Related

Having Trouble Configuring The SqlDataSource Control's Update And Insert Commands

Jul 24, 2007

I've just finished configuring the SELECT command for the SqlDataSource in my ASP.NET 2.0 web app.  It works fine and runs against a SQL Server 2005 database, using a stored procedure that I've written.
So, then I went to configure the SqlDataSource for the UPDATE and INSERT commands, and I've written two SP's for those as well.  In the designer the second form of the wizard asks for the Select statement.  I've already given that for the SELECT statement in the third form, and I also select the INSERT tab to specify the SP I want to use for inserting data and the UPDATE tab to specify the SP I want to use for updating data.  However, there appears to be no way that I can specify what the parameters are supposed to be for anything other than the SELECT command, through the designer.  Is that correct, or have I missed something?
 

View 11 Replies View Related

Passing Value To SqlDataSource Dynamically

Jul 10, 2006

Hello
Following is my code which is not working.
<asp:SqlDataSource ID=events runat=serverSelectCommand="SELECT * FROM TBL_EVENT WHERE SECTION_ID=<%= Session("ID")%>"ConnectionString = "<%$ appSettings:SQLConnectionString %>"</asp:SqlDataSource>
I want to pass the value of Session("ID") into that query. How can I do that?

View 4 Replies View Related

Dynamically Generate SqlDataSource

Jul 31, 2007

Hi, how I do create SqlDataSource in the code-behind,setting Select SQL along with its parameters and, finally automically generating Del, Update, Insert SQL.
Is there a way to achieve this goal as it would in VS designer?
Thanks,
Ricky.

View 2 Replies View Related

Dynamically Adding New Parameters To SQLDataSource

Dec 28, 2007

CancelSelectOnNullParameterHi,Suppose I have a SQLDataSource with a
SelectCommand="SELECT * FROM STOCKS WHERE USER=@USER ORDER BY STOCK_NAME"
and @USER is set as a session parameter. No problem till this part, but in some postbacks, I wish to add a new WHERE criteria to my SQL, so I do:DSSQL.SelectParameters.Add("@STOCK_NAME", "ABC123");
DSSQL.SelectCommand = DSgvStoklar.SelectCommand.Replace(" ORDER BY ", " AND STOCK_NAME LIKE @STOCK_NAME+'%' ORDER BY ");
gridViewDS.DataBind();
and wish that my SelectCommand is modified and a new parameter is added.
The SQL is modified, however -I guess- new parameter is not added, so I get "Must declare the scalar variable "@STOCK_NAME" error.
How can I solve, any ideas?

View 1 Replies View Related

Change Dynamically(via Code) The SqlDataSource For A GridView....

Mar 7, 2007

Hi,
say I have two Sqldatasources objects:SqlDataSource1 and SqlDataSource2....
Does anybody know how can I alter programmatically these two sqldatasources in a gridview?
Thanks!!!

View 3 Replies View Related

SqlDataSource SelectCommand - Dynamically Setting The Name Of The Table?

May 7, 2007

Can you dynamically set the name of the table in the SelectCommand section of the SqlDataSource? (If it is relevant, I code in C#)
 For example,
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:Test-MySQL %>" ProviderName="<%$ ConnectionStrings:Test-MySQL.ProviderName %>" SelectCommand="SELECT * FROM TestTable">
I would like to replace 'TestTable' with the name of a table that is extracted from a string array in the code-behind.
Appreciatively,Peter

View 4 Replies View Related

Dynamically Assign Select Statement To SqlDataSource

Jan 31, 2008

I wish to dynamically assign Select Statement to SqlDataSource. Anyone has any idea?? Is it possiable at all?
I am coding using C# under Framwork 2.0

View 1 Replies View Related

Dynamically Assign Select Statement To SqlDataSource

Jun 16, 2008

How can i assign select statement to a sqldatasource
I mean if the user clicks button 1
sqldatasource=-"select * from customers where status='ClOSED'  "
or else if the user clicks button2
 sqldatasource="Select * from Customers Where Status='OPEN'  "
 I want to bind the sqldatasource to a gridview finally .
 Is this possible ?
I tried sqldatasource filters  But am reallly confused
Any suggestions/solutions are appreciated
thankyou

View 8 Replies View Related

SqlDataSource: How To Give A Dynamically Defined SelectCommand Parameter

Dec 12, 2006

Hi all
I have a cms-page where i want to display various entry-categories like news etc....I want to define which kind of entries should be shown by a parameter in the URL (e.g. cms.aspx?category=news). So far everything is OK.
To display the entries actually I'm using the following SqlDataSource:
<asp:SqlDataSource ID="SqlDataSourceCMS" runat="server" ConnectionString="......."SelectCommand="SELECT * FROM [cms] where category = news"></asp:SqlDataSource>
What i need, is to set the category which i want to show dinamically, like with a variable.
Does anybody know how i can set something like a variable in the SelectCommand property of the SqlDataSource?

View 1 Replies View Related

Setting SqlDataSource Update Command And Parameters Dynamically C#

Aug 31, 2007

Hello all,
Ok, I finally got my SqlDataSource working with Oracle once I found out what Oracle was looking for. My next hurdle is to try and set the Update Command and Parameters dynamically from a variable or radiobutton list. What I'm trying to accomplish is creating a hardware database for our computers by querying WMI and sending the info to textboxes for insertion and updating. I got that part all working nicely. Now I want to send the Computer name info to a different table column depending on if it is a laptop or desktop. I have been tossing around 2 ideas. A radiobutton list to select what it is and change the SQL parameters or do it by computer name since we have a unique identifier as the first letter ("W" for workstation, "L" for Laptop). I'm not sure what would be easiest but I'm still stuck on how this can be done. I posted this same question in here a few days ago, but I didn't have my SqlDataSources setup like I do now, I was using Dreamweaver 8, it is now ported to VS 2005. Below is my code, in bold is what I think needs to be changed dynamically, basically i need to change DESKTOP to LAPTOP...Thanks for all the help I've gotten from this forum already, I'm very new to ASP.NET and I couldn't do this without all the help. Thanks again!
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CAT %>"ProviderName="<%$ ConnectionStrings:CAT.ProviderName %>" SelectCommand='SELECT * FROM "COMPUTER"' UpdateCommand="UPDATE COMPUTER SET DESKTOP = :DESKTOP, TECH = :TECH, SERVICE_TAG = :SERVICE_TAG WHERE USERNAME=:USERNAME">
<UpdateParameters>
<asp:ControlParameter Name="USERNAME" ControlId="txtUserName" PropertyName="Text"/>
<asp:ControlParameter Name="SERVICE_TAG" ControlId="txtServiceTag" PropertyName="Text"/>
<asp:ControlParameter Name="TECH" ControlId="txtTech" PropertyName="Text"/>
<asp:ControlParameter Name="DESKTOP" ControlId="txtComputerName" PropertyName="Text"/>
</UpdateParameters>
</asp:SqlDataSource>

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

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

Configuring 2GB RAM For SQL

Oct 30, 1998

Dear all

Problem and symptoms

We have recently added 1GB Ram to our systems and now we are trying to optimally configure 2GB of RAM for SS6.5 SP4 and we are getting the fllowing error INFREQUENTLY

"Not enough memory for pss allocation"

We have to restart the SQL server/ (recover databases) to get out of this. Since it is a heavily loaded production environment you can imagine the impact!!.

SPECS

OS-- NT4/sp3
H/W -- Dual Processor Alpha 4100
MEM -- 2GB
SQL PArameters:
memory--819200
Worker Threads -- 255
Proc cache -- 12%

Work done so far

There is a recommendation to reduce the memory or stack size parameters ref:Q160683!!

Question

1. I would like to know if anyone has got around a similar problem, and how. 2. As in NT Virtual Memory Manager AUTOMATICALLY brokers the allocation of physical memory between the requesting applications (e.g. sqlsrvr.exe) and the page file and no application can write directly to RAM, what does the memory parameter in SQL config control? Also then how is the above KB article relevant?

I look forward to your response

Thanks and regards

Arun

View 3 Replies View Related

Configuring SQL Cache

Apr 25, 2007

Hi all,
     I have a question regarding SQL caching.
     I want to use SQL caching for my pages.I've gone through http://msdn2.microsoft.com/en-us/library/e3w8402y(VS.80).aspx article on msdn, where in step by step procedure is explained for this. But I have a slightly different situation. In the article, we need to configure our application from web.config by following...
<!-- caching section group --><caching>  <sqlCacheDependency enabled = "true" pollTime = "1000" >    <databases>      <add name="Northwind"          connectionStringName="NorthwindConnectionString1"         pollTime = "1000"      />    </databases>  </sqlCacheDependency></caching>
 
Where in "NorthwindConnectionString1" is the SQLdatasource connection string. But I'm not using SQLDatasource, and have my own classes to build a connection datasource and get a dataset, and then bind it to my control.So in this case what should I write for the above "connectionstring"  attribute. My connection string is in web.config only with a section defined. and in my application i'm reading from web.fing only.The connection section i'm using is as follows...
<ConnSettings>
<add key="ConnString" value="server=serverName;database=dbName;uid=dbuser;Pwd=password"/>
</ConnSettings>
I want to know how to configure my sql cache in this situation.
 
Thanks,
Mehul Mistry

View 2 Replies View Related

Configuring SQL Datasource

May 29, 2008

Hi
When I try to configure a SQL datasource and I use a Microsoft SQL Server datasource I get a blank drop down list for server name.  My aspnetdb is available in SQL Server 2005 and I can log into it through management studio, and the service is started.  I am also using Vista Ultimate.
Is there any other configuration I need to do for Visual Studio 2008 to see the SQL Server instance?
Thanks
 Kwis

View 2 Replies View Related

Configuring SQL Mail - Help Please

Jun 18, 2001

Hi all,
I want to configure my SQL mail. I am able to configure SQL mail when i run the SQLAgent and SQL Server services under domain account for which Mail box was created in MS Exchange server. Also it works fine. But i want to Configure SQL mail without using Domain account (dont want to run services under domain account due to security reasons).

Anybody know how to Configure SQL mail without using domain account or is it possible to configure like that? Your suggestions are highly appreciated.
thanks in advance.
regards..

View 5 Replies View Related

Configuring SSRS On Win XP

Apr 4, 2008

Hi All,

I am fairly new to SSRS. I want to install SSRS on my local system which has OS of Win XP sp2 (not a server). I have installed SQL Server instance on this box. Can any body tell if i need Win Server 2000 or 2003 OS to install SSRS or can i use Win XP, if so please give some guidelines.

Thank's in advance..

View 2 Replies View Related

Configuring User In SQL

Sep 26, 2007

I new to SQL 2005 and have couple of questions regarding configuring the user. Let me start by saying what I need to be achieved.

1. Create a new user which will be user by couple of people to create and execute stored procedures
2. Deny all permissions for this user to access data from certain tables.
3. Configure the role and permissions for this user so that the above two is possible.


I was able to do the first two steps and when the users uses a query, ( select * from 'that table' ) the result in a permissions error. Also that user cannot view the table in SQL manager

The problem now is that that user can create a stored procedure that has the SQL statement Select * from 'that table' and execute the stored procedure to view the table.

The reason I created this user is to allow a team in the company to create stored procedures for Crystal. In theory he should be able to create stored procedures but not get any data from the denied tables. How can I achieve this?

I am trying to resolve this issue for a while now and any help is greatly appreciated.

Regards,

View 7 Replies View Related

Configuring SQL MAIL

Aug 4, 2005

Hi All,My question is that can I configure SQL MAIL, if my EXCHANGESERVER is on different domain and my SQL is running on differentdomain.Can anyone guide me for this because I googled a lotwithout any result.I am using SQL SERVER 2000 Enterprise Edition with service pack 3.and MICROSOFT EXCHANGE SERVER 2000.ThanksT.V

View 1 Replies View Related

Configuring SQL With Sp_configure

Jan 7, 2008


Can someone help? I am new to Visual basic programming and have down-loaded Visual Basic Express. I followed the instructions for creating my first database but when I got to making the SQL database I got the following error message. " Generating user instances in SQL server is disabled, use sp_configure "user instances enabled" to generate user instances" Where do I find sp_configure and how do I start it.

View 1 Replies View Related

Error While Configuring

Mar 28, 2007



While configuring reporting services, in the database setup section, I am entering the instance name connecting to, and the user-id details. On applying the changes, i am getting an error that "Using other edition of database for reporting data sources and/or report server databases is not allowed in this version of Reporting services"



Can anyone help me resolve this issue?



Thanks,

Vijay

View 5 Replies View Related

SQL Mail - Configuring

Sep 27, 2006

wasnt sure which forum to put this in - so i'll attempt here!

i have been trying to setup SQLMail in SQL2000 but have been having a few problems

i have created an Outlook MAPI profile for SQL to use. i have tested the profile and it is sending emails - the profile was created using the correct user which has local admin privileges and also a domain account 

i then assigned this profile to SQLMail within Enterprise manager and clicked Test. this completed successfully stating it was able to start & stop a MAPI session.

so i assumed that was all thats needed??

through Query Analyzer i run a simple test

EXEC xp_sendmail 'Craig.Gamble@<mydomain>.com' 'The DB is full'

i get a success message saying SQL mail sent. but it doesnt appear to send anything? i never recieve anything. The sent items does not contain anything and even when checking the actual Exchange server there is no sign of any mail being sent

i also checked the SQL account permissions to make sure it could access the Exchange Server using the

EXEC xp_cmdshell 'NET USE \EnterpriseIPC$' and again this returned success

so now im stumped!

is there anything else i can check to see where or what its supposedly sending??

any help greatly appreciated.
Cheers,
Craig

View 1 Replies View Related

Configuring Roles/Membership SQL To Not Use DBO?

Aug 26, 2006

I have a site with roles/membership working fine on my local machine, but I am having serious trouble deploying it to a shared host.  My hosting provides a sql 2000 database, but the user created for it that I use is not dbo.  I am errors when I try to access my site such as Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'The procedure was created under my user, so it's there, but it's full name ia myusername.aspnet_CheckSchemaVersionHow can I tell the asp.net membership/role provider to use my username instead of dbo when it looks for objects? Thanks   

View 6 Replies View Related

Urgent Configuring Sql Server

May 29, 2008

hi all i try all date convertion  function that u imagen   in my asp.net project to insert a date  to sqlserver datetime field but always sql server get the data as "1/1/1900 00:00:00"
how can i fix that from sql server
plz

View 8 Replies View Related

Error While Configuring XML Support In IIS With IIS 6.0

Dec 22, 2003

Hi,

I've two servers on which there is the SQL 2000 Server and the IIS 6.0.

I installed the SQL Server Client Tools on web server.

And created the nwind as told in booksonline.

I declared the SQLXML extention and allowed it using IIS 6.

But there is a problem with the virtual directory I created using the tool "Configure XML Support in IIS". Web server doesn't realize it as a virtual directory. Even a jpg or a text file is not served by the IIS.

The web server shows the following error.


ERROR: 500 Internal Server Error
HResult: 0x800706f4
Source: Microsoft SQL isapi extension
Description: Invalid virtual root settings



Thanks for any suggestions.

View 2 Replies View Related

Problem Configuring Workstation

Apr 14, 1999

How can I configure my workstation running WIN95 to used the SQL Enterprise Manager from the server end and other utilities. I have installed the client network utility.

Reason to use enterprise manager because I wanted to perform administrative tasks on my workstation and I've installed SQL SERVER 7.0(Standard version with 5 clients)on the WINNT 4.0 server.


Can anyone helps?

View 1 Replies View Related







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