|
hello
i am new to this and i am doing my assignment with vs2003. I need to create simple one page web project in vs2003 with one datagrid so I connect to northwind database in server ex. in vs 2003 and then drag a datagrid and then genereate dataset and configure dataset with database
but when i run the project it gives me error
Server Error in '/WebApplication3' Application.
--------------------------------------------------------------------------------
The SELECT permission was denied on the object 'Employees', database 'Northwind', schema 'dbo'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: The SELECT permission was denied on the object 'Employees', database 'Northwind', schema 'dbo'.
Source Error:
Line 192: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 193: 'Put user code to initialize the page here
Line 194: SqlDataAdapter1.Fill(DataSet11)
Line 195:
Line 196: End Sub
Source File: c:\inetpub\wwwroot\WebApplication3\WebForm1.aspx.vb Line: 194
Stack Trace:
[SqlException: The SELECT permission was denied on the object 'Employees', database 'Northwind', schema 'dbo'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
WebApplication3.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication3\WebForm1.aspx.vb:194
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2443; ASP.NET Version:1.1.4322.2443
waiting for your kind help
|
|
|
|
|
The error message says it all, the credentials you are using don't have SELECT access to the table. Use different credentials or add the rights to the user in Sql Server
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hello sir
thanks for your rep.
as you mentioned but i dont know how to do it so could you please tell me how to do it
waiting for your kind help
thanks
|
|
|
|
|
Don't know how to do what? Use a different connection string? Change permissions in SQL Server? If it's the former, then you need more help than just that. If the latter, then contact the SQL admin.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hello sir
yes it's done now thanks for your kind help
thanks again
|
|
|
|
|
Dear Freinds,
I have taken C1Toolbar on my master page, on click event of this toolbar, i try to generate excel from a grid on my content page.
There is one Filter button on Content page, for grid filtering.
When i click on Master page toolbar to generate excel report, and excel is re-directed on content page by "Response.Redirect("Excel");" statement.
After this process, whenever i click on Filter button on content page, master page toolbar event is called and the excel report is generated again. I dont know what is going wrong?
However, when i remove the "Response.Redirect("Excel");" statement the system works absolutely normal.
I dont know what is wrong? Please help.
I am exposing Master Page controls as public property and registering/calling its event on content pages.
Your expert opinion required.
Regards
|
|
|
|
|
Soulds like you are not checking IsPostBack
public void page_Load(...)
{
if(!IsPostBack)
{
Redirect...
}
}
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
My web form contains a popupextender when the popup is opened,after closing the popup the events outside the popoup like button click and dropdownselectedindex changed were not firing for the first time,second time the events are firing. Can anybody suggest me a sloution.....
|
|
|
|
|
hai,
Please make sure that you have included the
if(!IsPostBack)
{}
in the page load..
|
|
|
|
|
Recently One of my friend asked me to do a website for selling his audios/videos something education tutorials. I'm working in ASP.NET/SQL. So i was suggested him by creating shopping cart with online payment gateway.
But he told me an issue about shipping. He can possible maximum with in country, otherwise it will be critical because Some of CDs are in less price comparing the shipping price so some body don't want to that. He suggested me Online download if possible. After payment he can download the file with password access which works only once.
But i suspect it will not work out perfectly. I need to block the users who don't have access & how to determine the user downloaded the file or not, because i'll expire the password once he clicked the download link. So please suggest me, what to do for this. Any links also fine for me.
Thanks in advance.
|
|
|
|
|
I beleive, one thing you can do.. once the payment gets suceeded, you can show him a link to download the product and also you can send a mail with the link, and this will be only when after the payment.Now when the user clicks on the link , save in db that this product got downloaded corresponding to this payment.
So you can have some ID mapping to transaction and the product, you can send it in querystring of the link also if you have some login mechanism then you can save it also with the transaction and with the downloading user for cross verification.
So when user clicks on the link, check the db if its already downloaded or not if yes show the message else let the user download and update the DB as downloaded
|
|
|
|
|
Hi,
Iam developing a intranet site and want to track the users, iam using session for this purpose, Iam using windows authentication mode so there is no login form here..
when a user clicks the url for the first time a new session is created and at that time Iam adding a entry in a table(say :Users) with username and logintime and sessionid etc.,
Below is the logic Iam using in form_load event of Default.aspx
If session("user") is nothing then
---create new session (at this point Iam adding a entry in table(users))
Else
--- use the same session and continue the work.
End if
When i check the users in the table some entries are created with same userid and same sessinids with different login time, how this is possible...
I just want to know who is logged in and what time...
could someone explain, why this is happening..
Regards
Imtiaz A.K
|
|
|
|
|
If your using InProc session state then the session may be dropped due to memory pressure and then recreated when the user next requests a page. ASP.Net will use a valid session id from cookie if the client provides one.
This could also happen if the web application is running with more than one process (web garden/web farm).
To avoid it, use an external session state server (such as SqlServer or State Server).
|
|
|
|
|
This could also happen if the web application is running with more than one process (web garden/web farm).
what does this mean could you please elaborate the solution...
Thanks...
Imtiaz A.K
|
|
|
|
|
It means that of your using inproc session state the session data is stored per process. Having more than one asp.net worker process will cause this type of session duplication.
When you have two or more worker processes on a single server its called a web garden. If you have more than one server its a web farm.
|
|
|
|
|
Hi,
I am getting an arror like this.
"The timeout period elapsed prior to completion of the operation or the server is not responding."
(here i am retrieving more than 60000 records)
Any Idea?
Known is a drop, unknown is an ocean
|
|
|
|
|
|
Wow Wat a logic?
Thanks
Keep posting this kind of answers
Known is a drop, unknown is an ocean
|
|
|
|
|
Did you bother to go through any of the link?
This is a very common problem and have lots of answers on google.
As simply by the exception. Timeout is getting expired. So there are two ways..
First, increase the CommandTimeout say 120 then try,
Another thing, look into it why it is taking so much time.
One more thing, As I believe you would not be displaying this much record in the front end so better do some paging etc.. at DB level.
One last thing, before posting any question TRY GOOGLE
|
|
|
|
|
k, thanks
But i tried google. before posting question here, i always do it.
But that didnt work . i tried commandout method also. but no use.
This is my stored proc
CREATE procedure [dbo].[C_ToRemoveLocalDataDuplicateRecords]
as
begin transaction
--Insert the duplicate record to duplicate table
insert into tblLocalDataDuplicate ([AddressPK],[SlNo], [CategoryID],[ProjectID],
[WebUrl],[Name],[StreetAddress],[City],[State],[ZipCode],[Telephone],[SecondaryPhone],
[EmailID],[EnteredDate],[UpdatedDate],[UserId])
SELECT distinct(T1.[AddressPK]),T1.[SlNo],T1.[CategoryID],T1.[ProjectID],
T1.[WebUrl],T1.[Name],T1.[StreetAddress],T1.[City],T1.[State],T1.[ZipCode],T1.[Telephone],T1.[SecondaryPhone],
T1.[EmailID],T1.[EnteredDate],T1.[UpdatedDate],T1.[UserId]
FROM tblLocalData T1, tblLocalData T2
where T1.name = T2.name and T1.streetaddress =T2.streetaddress
and T1.city =T2.city and T1.state =T2.state and T1.zipcode =T2.zipcode and T1.telephone =T2.telephone and T1.SecondaryPhone =T2.SecondaryPhone
and T1.addresspk < T2.addresspk order BY name,streetaddress, city, state, zipcode,telephone,T1.addresspk
--Delete the duplicate records
delete T1
FROM tblLocalData T1, tblLocalData T2
where T1.name = T2.name and T1.streetaddress =T2.streetaddress
and T1.city =T2.city and T1.state =T2.state and T1.zipcode =T2.zipcode and T1.telephone =T2.telephone and T1.SecondaryPhone =T2.SecondaryPhone
and T1.addresspk < T2.addresspk
if (@@error > 0)
rollback transaction
else
commit transaction
i am not displaying any data in gvw instead of that i am displaying it in csv file.
Here i am checking for duplicate records (total records upto 60,000).
Known is a drop, unknown is an ocean
|
|
|
|
|
Hi Sree,
if you want to optimise, need more help then you put it in datatbase section.
You also can have some sql job that will run after certain period to remove th duplicate records. So this will be an independent process and will reduct the work that you are doing in your SProc here.
One thing, I dont know how are you generating the CSV file, but in one of my project we used SSRS that enables us to export the data in several format like csv,pdf etc so you can also use that.
|
|
|
|
|
Thanks Brij
Known is a drop, unknown is an ocean
|
|
|
|
|
To me, the query is not well optimized and I think, you should optimize your stored procedure.
I have optimized the query and it may work for you: -
WITH DuplicateRecords(Name,StreetAddress,City,State,ZipCode,Telephone,SecondaryPhone,AddressPK) AS
(
SELECT T1.[Name],T1.[StreetAddress],T1.[City],T1.[State],T1.[ZipCode],T1.[Telephone],T1.[SecondaryPhone],COUNT(*) AS 'NoOfEntries',min(AddressPK) as 'AddressPK' from #Test1
GROUP BY T1.[Name],T1.[StreetAddress],T1.[City],T1.[State],T1.[ZipCode],T1.[Telephone],T1.[SecondaryPhone] HAVING COUNT(*) > 1
ORDER BY T1.[Name],T1.[StreetAddress],T1.[City],T1.[State],T1.[ZipCode],T1.[Telephone],T1.[SecondaryPhone]
)
INSERT INTO tblLocalDataDuplicate ([AddressPK],[SlNo], [CategoryID],[ProjectID],
[WebUrl],[Name],[StreetAddress],[City],[State],[ZipCode],[Telephone],[SecondaryPhone],
[EmailID],[EnteredDate],[UpdatedDate],[UserId])
SELECT T1.[AddressPK],T1.[SlNo],T1.[CategoryID],T1.[ProjectID],T1.[WebUrl],T1.[Name],T1.[StreetAddress],T1.[City],T1.[State],T1.[ZipCode],T1.[Telephone],T1.[SecondaryPhone],T1.[EmailID],T1.[EnteredDate],T1.[UpdatedDate],T1.[UserId]
FROM tblLocalData T1 INNER JOIN DuplicateRecords T2
ON T1.addresspk = T2.AddressPK
--Delete the duplicate records
DELETE tblLocalData
WHERE addresspk IN(SELECT AddressPK FROM DuplicateRecords)
please let me know when you are done.
I hope this may help you.
Regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Since you have already tried few options, not sure if you have done this too, but it looks like response time got elapsed. One of the ways to increase it is using httpRuntime element in the Web.Config file.
You need to add something like:
<httpRuntime
executionTimeout = "number"
maxRequestLength = "number" />
For more details on it, read here: http://msdn.microsoft.com/en-us/library/e1f13641.aspx[^]
|
|
|
|
|
I want to be notified of any 404 (Page not found) errors via e-mail. I'm using Windows Server 2008, ASP.NET 3.5, C# code-behind, etc.
I have a page, that displays just fine upon 404 error, with the following in code-behind Page_Load():
System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress("from@domain.com");
System.Net.Mail.MailAddress to = new System.Net.Mail.MailAddress("to@domain.com");
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from,to);
message.Subject = "404 - File or directory not found";
message.Body = String.Format(
"The following page generated a 404 error:\n{0}\n",
Convert.ToString(Request.QueryString["aspxerrorpath"]) );
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("mail.domain.com", 2525);
try
{
client.Send(message);
}
catch
{
}
I've tried various stuff instead of Request.QueryString["aspxerrorpath"] , however I always end up with an e-mail message similar to the following:
From: from@domain.com [mailto:from@domain.com]
Sent: Friday, May 14, 2010 4:50 PM
To: to@domain.com
Subject: 404 - File or directory not found
The following page generated a 404 error:
And that's it. How can I figure out what page generated the error so I can e-mail the URL or location? Specifically, given the above example, what should I replace Request.QueryString["aspxerrorpath"] with?
Any ideas appreciated. Thanks in advance.
|
|
|
|
|