Use the following to get an image of the style
http://url:port/mapviewer/omserver?w=13&h=19&sty=M.HE_SCHOOLS_GIS&ds=DataSourceName
Saturday, 6 June 2015
Sunday, 10 May 2015
CSharp Read Resource File as Json
protected void Page_Load(object sender, EventArgs e)
{
mapResFileName = "MapResources.en-US.resx";
mapResFileName = "MapResources.en-US.resx";
if (m_UserLanguage == "ar")
{
mapResFileName = "MapResources.resx";
}
ClientScript.RegisterStartupScript(this.GetType(), "localizedString",
getReourseFileAsJSON(mapResFileName), true);
}
public string getReourseFileAsJSON(String resourceFileName)
{
try
{
string mapResString = "localizedString={'userLang':'" + m_UserLanguage + "',";
ResXResourceReader rsxr = new ResXResourceReader(
String.Format("{0}{1}\\{2}", System.AppDomain.CurrentDomain.BaseDirectory.ToString(), "App_GlobalResources", resourceFileName));
foreach (DictionaryEntry d in rsxr)
{
mapResString += "'" +
d.Key.ToString() + "':'" + d.Value.ToString() + "',";
}
mapResString += "};";
return mapResString;
}
catch (Exception exc)
{
return "File Not Found";
}
}
Tuesday, 5 May 2015
DROP all tables starting with “Na_” in Oracle
BEGIN
FOR c IN ( SELECT table_name FROM user_tables WHERE table_name LIKE 'EXT_%' )
LOOP
EXECUTE IMMEDIATE 'DROP TABLE ' || c.table_name;
END LOOP;
END;
create your MDSys Tables in your schema
create table my_user_sdo_geom_metadata as select * from user_sdo_geom_metadata;
create table my_user_sdo_styles as select * from user_sdo_styles;
create table my_user_sdo_themes as select * from user_sdo_themes ;
create table my_user_sdo_maps as select * from user_sdo_maps;
create table my_user_sdo_cached_maps as select * from user_sdo_cached_maps;
create table my_user_sdo_geor_sysdata as select * from user_sdo_geor_sysdata;
To insert them again to MDSys views
insert into user_sdo_geom_metadata select * from my_user_sdo_geom_metadata;
insert into user_sdo_styles select * from my_user_sdo_styles;
insert into user_sdo_themes select * from my_user_sdo_themes;
insert into user_sdo_maps select * from my_user_sdo_maps;
insert into user_sdo_cached_maps select * from my_user_sdo_cached_maps;
insert into user_sdo_geor_sysdata select * from my_user_sdo_geor_sysdata;
commit;
To insert them again to MDSys views without duplicate
insert into user_sdo_styles
(select * from my_user_sdo_styles
where name not in (select name from user_sdo_styles ))
insert into user_sdo_geom_metadata
(select * from my_user_sdo_geom_metadata
where table_name not in (select table_name from user_sdo_geom_metadata))
insert into user_sdo_themes
(select * from my_user_sdo_themes
where name not in (select name from user_sdo_themes))
insert into user_sdo_maps
(select * from my_user_sdo_maps
where name not in (select name from user_sdo_maps))
insert into user_sdo_cached_maps
(select * from my_user_sdo_cached_maps
where name not in (select name from user_sdo_cached_maps))
commit;
delete from user_sdo_styles;
delete from user_sdo_themes;
delete from user_sdo_maps;
delete from user_sdo_cached_maps;
delete from user_sdo_geom_metadata;
delete from user_sdo_geor_sysdata;
commit;
drop table my_user_sdo_geom_metadata;
drop table my_user_sdo_styles;
drop table my_user_sdo_themes;
drop table my_user_sdo_maps;
drop table my_user_sdo_cached_maps;
drop table my_user_sdo_geor_sysdata;
Sunday, 19 April 2015
ASP.net Unable to read resource bundle
Scripts.Render("~/bundles/modernizr")
Just add the Following in the module section the web.config file
<remove name="BundleModule" /> <add name="BundleModule" type="System.Web.Optimization.BundleModule" />
ASP.NET Routing and IIS 404 errors
ASP.NET Routing is a powerful feature introduced in .NET 3.5 SP1 and included with .NET 4.0 that allows a developer to route URL's that are not real files. There are several ways you can accomplish this same task, but having it in the ASP.NET pipeline allows the developer great flexibility in how URL's are routed. However, it does not always work "out-of-the-box" for devs. The most common error I've seen is a 404 error – meaning the page cannot be found.
There can be several contributing factors. If you are attempting to utilize extenionless URL's, ensure you have the appropriate IIS hotfix installed: http://support.microsoft.com/kb/980368. More commonly however, the issue is a result of the module not firing for your request type. The easy fix is to add runAllManagedModulesForAllRequests=”true” to the modules tag in your web.config. However, that could have performance implications as you are now telling IIS to ignore the preCondition setting for all modules. The alternative solution is to remove the managedHandler preCondition for the URLRouting module:
<modules>
<remove name="UrlRoutingModule" />
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
or <system.webServer>
<remove name="UrlRoutingModule" />
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
or <system.webServer>
<modules runAllManagedModulesForAllRequests="true"> </modules> </system.webServer>or Download and install the extension to the IIS support.microsoft.com
Thursday, 16 April 2015
asp.net write script in the page at run-time
There are many ways to write scripts inside html page using c# code behind, some of them
The following code snippet will append the script at the end of the page
ClientScript.RegisterStartupScript(this.GetType(), "keyOfScript", "console.info('Mohammad');", true);
The following code snippet will append the script at the beginning of the page
Response.Write("< script >console.info('Mohammad');< / script>");
The following code snippet will append the script at the end of the page
ClientScript.RegisterStartupScript(this.GetType(), "keyOfScript", "console.info('Mohammad');", true);
The following code snippet will append the script at the beginning of the page
Response.Write("< script >console.info('Mohammad');< / script>");
Subscribe to:
Posts (Atom)