DataSource Controls :: What Is Better: Connecting To DB With One Stored Procedure To Get Two Table At Once OR Connecting...

May 20, 2010

While working with LINQ to ENTITIES I see that there is only a way to use stored procedure that is returning one entity only, or a view that is a join of two entities.

But what if I need in ASPX page to get two tables that there is NO connection between them, no join can be done between them at all.

I have one Stored Procedure that return the two tables, but entities don't support this right now.

I can split them to two Stored Procedure and call each of them separately.

View 2 Replies


Similar Messages:

DataSource Controls :: Connecting To A Particular Table In Database Using VS 2008 Form?

Apr 22, 2010

I have no trouble connecting to a SQL server with code in my web config file for user registeration. But I am having trouble telling it to go to a particular table.

Here is what is in my web config file:

<connectionStrings>
<add name="homeowners" connectionString="Data Source=countrypark3.db.5503108.hostedresource.com;Initial Catalog=countrypark3;User ID=xxxxx;Password=xxxx; Trusted_Connection=False" providerName="System.Data.SqlClient" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString=" Server=whsql-v04.prod.mesa1.secureserver.net; Database=DB_675; User ID=user_id; Password=password; Trusted_Connection=False" providerName="System.Data.SqlClient" />
</connectionStrings>

I'm trying to get it to point to the homeowners table.

View 5 Replies

DataSource Controls :: 2nd Server Not Connecting?

Apr 8, 2010

i have a project running good (database and application both are in same server). some days before we've decided to place databse (sql server 2000) in different server.we created new server with windows server 2003 and Sql server 2000; nothing else is installed in it.And then i register new server's sql in old server's sql server. it connected successfully. even i can fire a query to new server from old server.

Both new and old server having windows server 2003 and Sql server 2000.

Now the problem :I CAN NOT ACCESS NEW SERVER'S DATABASE FROM MY APPLICATION.

I have changed my web.config as under :

OLD :<connectionStrings>

<add name="ConnectStr" connectionString="Data Source=OLDSERVER;Initial Catalog=DataExtractor;Persist Security Info=True;User ID=123;Password=123;pooling=true;Max Pool Size=50" providerName="System.Data.SqlClient"/> [code]....

View 3 Replies

DataSource Controls :: Connecting To SQL Server On VPN?

Mar 9, 2010

I need the syntax for a connection string in web.cong to connect to a SQL Server 2005 database that is on a VPN. I have an account on the DB that I can use....just don't know how to construct the connection string properly.

View 4 Replies

DataSource Controls :: Website Not Connecting To Database

Mar 8, 2010

Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider. I have set up a db locally which mimics the production DB, THe production db and website has no has no issues.

THis used to work till i had hard disk failure and had to reinstall all software and do the db from scratch. Used the table scripts and ran the aspnet_regsql. I am using sql server express 2008 asp.net 3.5 I am using custom provider for Roles and custom membership provider for Memberships. Pretty sure the problem is in the db permissions, though I have set up Users in the Security of the DB.

[Code]....

View 7 Replies

DataSource Controls :: Error While Connecting To SQL Server?

Apr 1, 2010

When ever I try to connect to server through Microsoft sql server management studio express then an error is generated saying that

Cannot connect to .//SQLEXPRESS

Additional Information

A network related or instance specfic error occured while connecting to SQL server. The server not found or not accessible verify that instance name is correct and that SQL server is configured to allow remote connections.(Provider: Named Pipes Provider, error 40-could not open connection to SQL server )(Microsoft SQL server, Error:53)

View 5 Replies

DataSource Controls :: Connecting Database To The Online Server

Feb 8, 2010

connecting my database to the online server. My server is seekdotnet. But I had been receiving this error code Cannot open database "database.bak" requested by the login. The login failed. Login failed for user '219_nypmecom'.

View 1 Replies

Forms Data Controls :: Datasource Not Connecting To Database

Jun 24, 2010

I am using Visual Studio 2008 and asp.net technology with C# language. Whenever I try to choose any datasource for databound control like "gridView" of "ObjectDataSource". The connection can be tested as OK but when I click on OK the it gives following error and database could not be added: "Object Reference not set set to an instance of an object." it was working perfectly fine in Visual Studio 2005, so kindly help if there is some settings that are to be adjusted for 2008 version.

View 9 Replies

DataSource Controls :: Connecting To Database - Login Failed

Jun 30, 2010

I was working on a asp.net project earlier but due to some OS problem I had to re-install the OS..so before re-installing the OS I detached my sql database and then attached it back after installation..but I am having a login problem now..the previous servername was XYZ-DB840C74SQLEXPRESS..so this user i.e. XYZ-DB840C74ASPNET is added to the database's permissions..now my new server name is XYZ-8D50FD73SQLEXPRESS..but I am unable to add this user through the permissions wizard..I am getting the following error: Cannot open database "finance" requested by the login. The login failed. Login failed for user 'XYZ-8D50FD73ASPNET'.

View 7 Replies

DataSource Controls :: Connecting To Remote Database Using DSN And ODBC?

Mar 25, 2010

In my windows application, i am listing the System DSN's configured on the remote machine in a combobox. Once i select the DSN and click on Connect button, i should be able to connect to the remote database. I am trying to open the connection to the database using ODBC but am getting the below error.

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

Below is the code sample

string conn = "Provider=MSDASQL;Remote Server=http://BLR1WKD010; Remote Provider=MSDASQL;DSN=" + clsODBC.pDBName + ";UID=" + txtUsername.Text + ";PWD=" + txtPassword.Text;

OdbcConnection odbcConn = new OdbcConnection(conn);

odbcConn.Open();

View 5 Replies

DataSource Controls :: Connecting Dattabase On Hosted Server?

Mar 29, 2010

I am trying to host my website developed on ASP.NET framework 3.5. this website project is working perfectly on my system in local host enviorment. but when I try to upload it to hosting server ( mochahost.com-- hosting server) it is creating problem.

I have uploaded all the webpages to standard folder, created the database using script file, I can see the table and data through Plesk control panel, so database creation is not the problem. I have change the connection string in web.config file according to the template given on the site.

here's the connection string I am using:

<connectionStrings>
<add name="JJMCONDO" providerName="System.Data.SqlClient" connectionString="data source=db200.my-hosting-panel.com;Initial Catalog=ahalyam1_varun;User ID=xxxxx;Password=xxxx" />
</connectionStrings>
where JJMCONDO is the connection name
database name: ahalyam1_varun

[Code]....

View 2 Replies

DataSource Controls :: Connecting To A Windows Authenticated Sql Server?

Apr 14, 2010

When i go to insert data into the sql server db i get an error when it tries to connect.

Heres the code

string sConnectionString = "Integrated Security=SSPI;Initial Catalog=;Data Source=localhost";
SqlConnection objConn = new SqlConnection(sConnectionString);
objConn.Open();

It is on an on button click event.

The area that shows up in the error message is

objConn.Open();

View 6 Replies

Forms Data Controls :: Connecting A DropDownList To A DataSource?

Jul 13, 2010

I have a problem with connecting a DropDownList to a DataSource.

The scenario: When I add am item to the database (I do this using a GridView/ObjectDataSource / SPROC) I want to update a DropDownList that lists this items as well.This DropDownList is linked with another ObjectDataSource. Now, I listen to the RowCommand event of the GridView and in a certain case I refresh the DataSource of the DrpoDownList and do a DataBind to the DropDownList afterwards.

The strange thing is, that when I take a look at the DropDownList's Items-Collection during the Page's OnPreRender event handling, the items collection contains the new entry but the new entry is not rendered, i.e. when I take a look at the rendered HTML the <option></option> entry for the new value is missing.

After another postback to the page the entry appears in the DropDownList?

View 3 Replies

DataSource Controls :: Using Table Variable In Stored Procedure?

Feb 18, 2010

I've written a stored procedure which uses a table variable. The stored procedure is shown below:

[Code]....

The table variable @CaseNumbers is declared, and is a bunch of values are inserted using a table-valued function called SplitStringIntoInts. At this point I can select from @CaseNumbers and this works fine.But when I try to join onto @CaseNumbers, the name '@CaseNumbers' in the ON clause is highlighted with the error 'Must declare scalar variable @CaseNumbers'. What?! It's not scalar, I declared it ages ago and I have used it since!

View 3 Replies

DataSource Controls :: Connecting Two Servers With A Readonly Privilage To A Database?

Apr 12, 2010

I have two PCs with Windows Server 2003 standard adition installed on them, each are in a saperte room, and having SQL Server 2005 Express. Now I want to let Myserver to connect to server1 with a readonly access to a database on it. I figured to create a user acount on server1, and make it as a login account in SQL Server and grant the appropreate privilage. Now I'm wandering are there any security risks regarding this approch.

View 1 Replies

DataSource Controls :: How To Join Table In Stored Procedure Sql Server Db

Jun 9, 2010

my stored procedure is always extract some data into temp table such as"select name,address,content into #TEMP1 from table1,table2,table3"
finally, select another table together with #TEMP1 to extract all desire data from one queryselect T.name,T.address,T.content,C.other from #TEMP1 T, otherTable C
where T.ID=C.IDI would like to ask if i want to join one more table T2 into final query with "otherTable left C outer join on C.ID=T2.ID"

View 1 Replies

DataSource Controls :: When Use ##Temp Table In Stored Procedure, It Gives An Error?

Jun 15, 2010

i m using ##Temp Table in stored procedure..it gives this error There is already an object named '##people' in the database.in two codition1.in case of multisession2. if transaction drop in between even i drop Table in Last in stored procedure..what can i use in place of temp table to hold data for a time being

View 1 Replies

DataSource Controls :: Stored Procedure Does Not Indicate Table Returned In Dataset?

Apr 23, 2010

This may not be the correct place to put this as it is both a stored procedure AND Visual Studio 2008 problem.

I have the following stored procedure:

[Code]....

I have been mokeying around with it because of what is happening. I have a dataset, call it dataset1. I drag this stored procedure onto the dataset. I EXPECT a datatable to appear, instead the data set adds this store procedure to the queries table adapter and sets the exec mode to 'NonQuery' which unless I am very mistaken, means "don't expect a dataset back from this' when in fact you DO expect a dataset back from this.

The SQL server is a Windows 2000 Server running SQL 2000. It has never caused us a moments grief since we set it up oh-so-many years ago.

If I connect to a different database and drag a query into the same dataset I get a datatable as I expect. I cannot see where / how this procedure could be wrong. The query when executed returns exactly the data I expect, in the format I expect (looks like a table, acts like a table in the Query analyzer).

View 3 Replies

DataSource Controls :: Insert ID Field Into SQL Table Programatically From Stored Procedure?

Oct 6, 2010

I have a table in SQL where I insert data (CatCodes) using C# code but I want to insert ID code (DealerID) with it as well. Following is my Stored Procedure and C# code:

[Code]....

C#:

[Code]....

As you can see, I am insering CatCode values in Categories table using string cbspecialities.

How can I insert DealerID the same way? DealerID is automatically generated in tblDealers table when "InsertExternalInfo" asp.SqlDataSource control runs "InfoInsert" SP.

[Code]....

View 2 Replies

DataSource Controls :: Eliminate Returning Of Empty Table From Stored Procedure

Jul 12, 2010

I have a Procedure which should return only 1 Record on selecting record according to Priority.

BEGIN
DECLARE @Accounts nvarchar(MAX)
SELECT @Accounts = ISNULL([map_user_modules].[Accounts], '') FROM [map_user_modules]
WHERE [map_user_modules].[id_user] = 231 AND [map_user_modules].[id_module] = 5
IF ((@Accounts = '') OR (@Accounts = 'All'))
SELECT @Accounts = null

BEGIN
Select @@ROWCOUNT as Priority2
END
IF @@ROWCOUNT = 1
BEGIN
Return
END

BEGIN
Select @@ROWCOUNT as Priority3
END
IF @@ROWCOUNT = 1
BEGIN
Return
END

BEGIN
Select @@ROWCOUNT as Priority4
END
IF @@ROWCOUNT = 1
BEGIN
Return
END

In the above statement Suppose we take a scenario where Select @@ROWCOUNT as Priority3 is executed, I get two tables returned, One is the Table returned by Select @@ROWCOUNT as Priority3 and the other is the Table returned by Select @@ROWCOUNT as Priority2 which has no Records. How can I eliminate the Empty table that returns no records.

View 1 Replies

DataSource Controls :: Get The @@Identity From A Table By Using A Stored Procedure Called By Website

Jul 10, 2010

I am trying to get the @@Identity from a table by using a stored procedure called by my asp.net website. I am using a datareader to do this but get an error as it tells me it cannot convert the returned value to getint. Here is my code. What should I be using instead of getint?

Dim myReader = cmd.ExecuteReader()
While (myReader.Read())
intID = myReader.GetInt32(0)
End While
myReader.Close()

View 3 Replies

DataSource Controls :: Create A Stored Procedure That Displays Data From A Table?

Mar 22, 2010

More specifically, i'm trying to create a stored procedure that displays data from a table if the date column in the table matches a specific day of the week. (IE. Monday, Tuesday, ect...)

The date in my table is stored as MM/DD/YYYY.

View 5 Replies

DataSource Controls :: Connecting To Remote SQL Server Fine From Dev, Fails From Production Host

Feb 16, 2010

I have a SQL server in my office. I can connect from my home development workstation website to the remote SQL server with no problems but when I upload the site to the web host and try and use the same SQL server it fails with 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible'

View 4 Replies

DataSource Controls :: Stored Procedure For Delete Records From Parent And Child Table

Jan 16, 2010

I have two tables dept and employees those table have parent and child relation ship link column is deptno i want to delte department even this departmetn contains employees i want to write storedprocedure for first delte employees and after department if i wrtie these two querys in storedprocedure will i get any problems

Begin
Delete from tbl_employees where Department_Id=@Department_Id
Delete from tbl_Department where Department_Id=@Department_Id
RETURN
END

View 5 Replies

DataSource Controls :: How To Convert The Oracle Stored Procedure To Sqlserver 2005 Stored Procedure

Apr 2, 2010

This is surareddy. i nead some small clarification in the "Stored Procedure"

how to convert the oracle Stored Procedure to sqlserver2005/2008 Stored Procedure.

right now i am enhancing the project that project already developed the oracle Stored Procedure. now our company is using sqlserver 2005/2008.

how to convert the Oracle Stored Procedure to sqlserver 2005 Stored Procedure

View 4 Replies







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