DataSource Controls :: Aspnet_regsql Results Not Showing In Administration?
Oct 4, 2010
I'm trying to tie my login controls to my externally hosted database. I used the aspnet_regsql tool to create the appropriate tables in the database, but when I try to administer them through the "Administer Website" smart tag on the login control I cant connect to the new tables and such in the "Providers" tab.
I would like to show the results from the search in another page. How do I show the results of the search in another page when the user press the button?
I am using the SQLDataSource control and binding it to a gridview. When there are no records returned the gridview header is not showing. I want it to show no matter what is returned. I am not calling a stored procedure - I am writing my own select statement in the SelectCommand. How to show the header with no results? I searched but did not find an answer when using the SQLDataSource.
I am trying to run a stored proc from this function. When I run it thorugh the debugger I can see that myReader.HasRows = true and myReader.FieldCount =14.
But the control does not go in the loop while (myReader.Read()) where I am trying to read Version field returned by the stored proc.
As you can see, the first 3 documents are for the same NIIN, and their total QtyReq is 6, however there are only 5 Available for this NIIN.
I need a way to remove the document 12346 because it cannot be filled, the other 2 document can though. I cannot figure this one out, but it seems like it should be pretty easy.I am using MS SQL Server 200
So far I have the following code but it doesn't generate the menu?
While reader.Read() ' set title sitetitle = reader.Item("siteName") mydata &= reader.Item("pagetitle") ' check subtitle exists, if so, build menu, loop though subtitles somehow? if not IsDBNull(reader.Item("subtitle")) mydata = "<ul>" mydata &= "<li>" & reader.Item("subtitle") & "</li>" mydata &= "</ul>" end if End while
Qeury and result set below:
sql:
SELECT subpages.subpageid, pages.pageid, sites.sitename, sites.siteid, pages.siteid,pages.pagetitle, subPages.subtitle FROM pages LEFT JOIN sites ON pages.siteid = sites.siteid LEFT JOIN subpages ON subpages.subpageid= pages.pageid WHERE sites.siteID = 1 ORDER BY sites.siteid, pages.pageid, subpages.subpageid ASC
results:
subpageid | pageid | siteid | siteid | pagetitle | subtitle NULL 1 SCHS 1 1 Sandwell Community Healthcare Services NULL NULL 2 SCHS 1 1 About Us NULL NULL 3 SCHS 1 1 Your Services NULL 4 4 SCHS 1 1 Equality and Diversity Team at SCHS 1111 4 4 SCHS 1 1 Equality and Diversity Team at SCHS 2222 4 4 SCHS 1 1 Equality and Diversity Team at SCHS 333 4 4 SCHS 1 1 Equality and Diversity Team at SCHS 44444 NULL 5 SCHS 1 1 Single Equality Scheme NULL NULL 6 SCHS 1 1 Diversity Strands NULL NULL 7 SCHS 1 1 Equality Impact Assessments NULL NULL 8 SCHS 1 1 Quality and Safety Committee NULL NULL 9 SCHS 1 1 Contact Us NULL
I am trying to populate the textbox with store procedure results.I am getting the Error As Follows :
There is already an open DataReader associated with this Command which must be closed first.Here Storeprocedure i m using n my C# Code.
Store Procedure: ALTER PROCEDURE GetAllHolidaysByUser( @FirstName nvarchar(30),[code]....
I just want to display the results of store procedure by any means.I dont know who to populate Gridview using the store procedure by giving two input paramters.
I have a single column returning SQL data source and I want to use the data for a simple if statement, but for the live of me I can't figure out how to do it. *oh for the old days, I wrote the same thing in simple asp in about 45 seconds*
[code]....
For the life of me I can't figure out how to get that data into a variable or any way to access it. I know its probably simple. I have tried functions, etc off the net but everything I try results in another error.
I was trying to find out how to search a repository and ensuring the results returned are only for the items in the repository which match the search text. For example:
[Code]....
Where i have "where s.SupportIssueID.... I want only the results which have an ID that matches or is LIKE the given "searchText". I thought I could use s.SupportIssueID.Contains but this isnt available in the helpers.
pull data from 3 databases, same query with the same result set (data can vary) and i want to combine those results in to a single datareader so i can easily dump it to a gridview.
im new to linq and im having lots of trouble creating complex queries.. My problem mainly is that i am using Linq as a BLL.
i created a dbml (with namespace called DAL) file with 2 tables with a one to many relation. Pop and City. There is a forgien key in pop that points to a city. I also created a class called Pop that inhertis DAL.Pop. Now in my ASPX page, i want to call a function in the Pop class that would retrieve some Pop according to its ID, but i need the city name as well.. Ive been going around this in circles for days. I dont know how to write the Linq syntax and i dont understandd how my function's signature should be like.. I want to recieve a table that i can bind to a Gridview and preferable, specify which coloumns to bind.
I have a SQL server job that executes msdb.dbo.sp_send_dbmail procedure and sends an email. I have specified the query and the query results appear in the body of the email as expected. All i need to know is how to remove the dashes beneath the column names. For instance, when I receive the email with the query results, they look like the following
UserId UserName
1 Rob 2 Paul
How do I remove those dashes underneath the column names?
i have a "Users today" function that i am trying to work on, i have all the tables set up, and a TimeStamp column, i would like to know how i could get all the users that appeared, but for that day only.
So i used the select statement, but then when i tried to add into query, filtering, i tried using the DateTime.Now, but it only got the users specific to that date, hour, and second.
Im using SQL Server 2005 and im using stored procedures. Is this possible? i need to get a number of results and do it in one SELECT statement or just one result set. Im using MS Chart Controls for reporting and they cant seem to process multiple result sets this is my problem, so basically to run a barchart i need to assign a column to the X axis and a column to the Y axis and it will then display my results.
My stored procedure below returns a result set with columns subpolicy_name, building_name, floor_name, room_name and total_savings. Im just wondering is it possible to split my total_savings column into 4 columns, for example subpolicy_savings, building_savings, floor_savings and room_savings, i need everything in a separate column. If you run this stored procedure you will see the result set.
I have a set of controls on my page, Start Date, End Date, User, Status
Start and End Date are expected to always contain a value
User and Status I want to also have an 'All' option, where in it would return all results/not filter.
One method I can think of using for this, is the put the queries in a If scenario, where
if(user == All), use linq query B if(user != All), user linq query A
where linq query A contains the filtering on Users, and linq query B does not.
What I have so far is
[Code]....
What I need
[Code]....
where User == ??,
can the control that populates that contain a wild card option as well? ie *, so that if user == Name, it filters on Name, or if user == *, it returns all?
I am working on asp.net 3.5 and in MVC using Linq to SQL classes. In my MVC project i am calling stored procedure using linq to sql that conatin query joining two tables.Below is my code in Partial class
[ Function(Name="dbo.GetUserWiseThreadDetail_SP")] [ResultType(typeof(Thread))] [ResultType(typeof(Reply))] public IMultipleResults GetUserWiseThreadDetail_SP([Parameter(DbType="VarChar(30)")] string userID) { ExecuteResult result = this.ExecuteMethodCall(this, (MethodInfo)(MethodInfo.GetCurrentMethod())), userID); return ((IMultipleResults)(result.ReturnValue)); }
In one of the controller i have made one more class
public class MypostIndexData { public IEnumerable<Thread> Thrds { get; set; } public IEnumerable<Reply> Repls { get; set; } public MypostIndexData(IEnumerable<Thread> thrds,IEnumerable<Reply> repls) { this.Thrds=thrds;this.Repls=repls; } }
finally coding of controller action method
ForumDataContext pmforum = new PMForumDataContext(); public ActionResult MyPosts(string userId) { IEnumerable<Thread>thrds; IEnumerable<Reply>repls; IMultipleResults result = pmforum.GetUserWiseThreadDetail_SP(userId); (this satement doesnot give any result,if i execute stored proc in sql it give the results) thrds = result.GetResult<Thread>(); List<Thread> thrdlist = new List<Thread>(thrds); repls = result.GetResult<Reply>(); List<Reply> replylist; if (repls != null) { replylist = new List<Reply>(repls); } return View(new MypostIndexData(thrds,repls));
I am unable to understand why i am not getting any results?
I am actually using 2 type of queries in my website e.g
These Queries are from my stored procedures
SELECT * FROM TblName WHERE FREETEXT(ColumnName, @parameter)
AND
SELECT * FROM TblName WHERE CONTAINS((Column1, Column2), @parameter))
I have enabled Full Text Indexing on my tables both local and on my hosting company MS SQL Server.
The above queries are working fine on my local database and return results but these queries return nothing when i try to run them on hosting company MS SQL Server.
I have identical data on both MS SQL Servers and both servers are 2008.
I am trying to get the results of the variables from a stored procedure to write out somewhere so I can see what values are being passed through for each variable in a button click. Does anyone know how to do that. Here is my code for the button click:
[Code]....
Here is my variables in the stored procedure. The first is the select statement and then the update:
Not sure if this is for SQL or .net! I have 3 tables which looks like
table1 ID Name 1 Jon
and
table2 ID Number Job 1 1 IT 2 1 Web 3 1 Admin
table1 ID ContractType 1 Temp 1 Perm
An inner join makes one table with 3 rows (I excluding the ID from table 2 for the join) which is saved as a view
viewTable ID Name Number Job ContractType 1 Jon 1 IT Temp 2 Jon 1 Web Temp 3 Jon 1 Admin Temp 4 Jon 1 IT Perm 5 Jon 1 Web Perm 6 Jon 1 Admin Perm
I want to display these results on a web page via the grid view. However, I don't want to show the user 6 times! I want to show the user name once, the contract type once and each Job! What is the best way to do this? Is there a fault with the database design already? I assume the easiest answer is to not join them in a view but query each section 3 times from the website but I'd rather 1 connection only!