LinqDataSource is showing Error in DotnetNuke Module - c#

When I am Select Page Setting Option in DNN below error is showing.
Error:
A critical error has occurred. Could not determine a MetaTable. A MetaTable could not be determined for the data source 'LinqDataSource1' and one could not be inferred from the request URL. Make sure that the table is mapped to the dats source, or that the data source is configured with a valid context type and table name, or that the request is part of a registered DynamicDataRoute.

Look at here http://dnnlinqtosqladapter.codeplex.com/ and download sql Model adapter and follow the steps and it can solve your problem.
Try it and let me know about.

Related

Override the default error page 500.30 - ASP.NET Core app failed to start

I am attempting to create a custom error page display to run in my app when there is an issue with the database connection string.
When I alter the string to something invalid, I receive the error mentioned in the title above.
Is there any way to override this page and show a more informative one that would tell me that my DB connection string is wrong?
There is a InvalidOperationException that is thrown in the Startup.cs file, but I'm unsure on how to extract this from the startup file and use it, when my app fails to start in the first place.
Is this possible to do?
You can disable the default error page by using the disableStartUpErrorPage="true" setting in web.config for the IIS hosting module. This will just fallback to another custom error page of your choosing served by IIS, rather than allowing you to show a dynamic custom page.
Documentation

How to change my schema for each request?

I would like to change my schema dynamically depending the HTTP Request based on the UserID. I know that the OnModelCreating is just started one time and i try the DB Interceptor with Npgsql but no sucsess !
I have a specific schema by user and i would like to read and write some data inside.
Techno: Asp.Net 4.5
Thank you
In PostgreSQL, the schema that is search/defaulted can be set on the ConnectionString. The parameter is called "Search Path". More information can be found here.
So if you have control over the connectionstring before connecting you can add the parameter ;Search Path=ABC_USERID,public. This says that look to ABC_USERID schema and if it doesn't find it then search in public schema
As long as you don't qualify the table name with a schema it will for the objects in your search path.
-HTH

How to resolve "The server does not support the control. The control is critical." Active Directory error

When trying to get all users from AD based on a role I was getting the exception:
System.DirectoryServices.Protocols.DirectoryOperationException: The
size limit was exceeded
With help of this thread :
LdapConnection SearchRequest throws exception for “The size limit was exceeded I tried implementing paging.
Now I am getting an exception:
The server does not support the control. The control is critical.
Any ideas on how to go about resolving it? I get a smaller list of role based users fine without paging.
Thanks.
UPDATE:
I found code to check if paging is supported by AD here iPlanet LDAP and C# PageResultRequestControl and I got the result that paging is supported.
It is true that it helps to change from AuthType.Basic, but in case anyone wants to get it working with AuthType.Basic then you need to make sure to set LDAP protocol version to 3:
var connection = new LdapConnection(new LdapDirectoryIdentifier(server), null, AuthType.Basic);
connection.Bind(new NetworkCredential(username, password));
connection.SessionOptions.ProtocolVersion = 3;
I found this solution here: https://groups.google.com/d/msg/microsoft.public.active.directory.interfaces/x1ZiixXknqk/m7-Li21QBoIJ
The solution posted in response to thread Paged LDap search fails with “The requested attribute does not exists” helped me with my issue too. I was using AuthType.Basic and changing it to AuthType.Ntlm had the paging code running fine. I doubt it will affect any other piece of AD code that I have but I'll check and post if I find anything to watch out for.
Thanks.
I recently experienced this issue even though I had explicitly set the LDAP version number to 3 and was using NTML authentication.
In my case there was a mutli domain Active Directory Domain Services forest and the problem was resolved by changing the port number used to establish the LDAP connection from 389 to 3268.
It turns out that these ports have very specific purposes -
389 - requests information from the local domain controller. The local domain controller has access to the complete list of attributes for all objects within the domain however querying for objects stored on an another domain requires referral chasing and this was where I was seeing "The server does not support the control" error.
3268 - This port is used to access the Global Catalog, this is a repository of all of the objects within the entire forest. It does have it limits in that the Global Catalog only stores attributes that have been marked for replication. Another side effect is that the Global Catalog is much more performant that access the local domain controller as it has no reliance on referral chasing to work.

How to handle the SQL injection response for best practice

We are using the web security scanner which found out one of my web page has a Bind SQLi. The scanner modified the parameter "news.aspx?id=123" to "news.aspx?i=123' or 1=1--", And the web server responses to the news information for id=1 information currently.
After investigation from development team, they said that there's no injection cannot access to Database which has already blocked by the .NET Built-in API SQL Parameter, and the back-end program will auto return the data of id=1 information to client side.
May I know can it be identified as false positive, or is it better to redirect to generic error pages? Or it is enough and acceptable for current stage?
the back-end program will auto return the data of id=1 information to client side.
IMO, this is a lame behavior for the backend. I'd say the page should detect the error and redirect the user to an error page. Nevertheless, based on that description it is not a valid injection, so if the business can accept that behavior, then it is a false positive.
P.S. While this isn't a SQL injection, it is potentially an information disclosure bug if it's possible to get the page to display the data for id=1 and the user of the page shouldn't have access to that particular record.
So long as your underlying application code is parameterizing the values being sent to SQL (as your developers claim), then you do not need to worry about such warnings.

Why is DynamicData not working on new 2012 Server?

I have an ASP.Net website that uses DynamicData controls that works on it's current server and locally, but any page with dynamic controls fails on the new 2012 server i'm setting up. Everything is pretty much identical from an application perspective.
Error:Exception type: InvalidOperationException
Exception message: Could not determine a MetaTable. A MetaTable could not be determined for the data source '' and one could not be inferred from the request URL. Make sure that the table is mapped to the data source, or that the data source is configured with a valid context type and table name, or that the request is part of a registered DynamicDataRoute.
Is there a missing config, feature, or role missing possibly?
It turns out the app pool was not configured correctly. It needed to be set to .Net 2.0 - integrated pipeline.

Categories

Resources