Click here to Skip to main content
15,921,212 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionto import all tables Pin
sk_ko19-Nov-11 19:27
sk_ko19-Nov-11 19:27 
AnswerRe: to import all tables Pin
jkirkerx19-Nov-11 20:22
professionaljkirkerx19-Nov-11 20:22 
QuestionWorking with cached DataTables ? Pin
devboycpp19-Nov-11 6:47
devboycpp19-Nov-11 6:47 
AnswerRe: Working with cached DataTables ? Pin
jkirkerx19-Nov-11 19:16
professionaljkirkerx19-Nov-11 19:16 
Questiondata source problem with web control Pin
rachel_m19-Nov-11 6:05
rachel_m19-Nov-11 6:05 
AnswerRe: data source problem with web control Pin
jkirkerx19-Nov-11 19:29
professionaljkirkerx19-Nov-11 19:29 
GeneralRe: data source problem with web control Pin
rachel_m20-Nov-11 8:43
rachel_m20-Nov-11 8:43 
GeneralRe: data source problem with web control Pin
jkirkerx20-Nov-11 9:10
professionaljkirkerx20-Nov-11 9:10 
GeneralRe: data source problem with web control Pin
rachel_m20-Nov-11 14:32
rachel_m20-Nov-11 14:32 
GeneralRe: data source problem with web control Pin
jkirkerx20-Nov-11 15:19
professionaljkirkerx20-Nov-11 15:19 
QuestionSite navigation link generation using sitemap Pin
Tridip Bhattacharjee18-Nov-11 23:46
professionalTridip Bhattacharjee18-Nov-11 23:46 
AnswerRe: Site navigation link generation using sitemap Pin
jkirkerx19-Nov-11 19:35
professionaljkirkerx19-Nov-11 19:35 
AnswerRe: Site navigation link generation using sitemap Pin
Bernhard Hiller20-Nov-11 19:52
Bernhard Hiller20-Nov-11 19:52 
QuestionURL routing issue asp.net 4.0 Pin
Tridip Bhattacharjee18-Nov-11 23:42
professionalTridip Bhattacharjee18-Nov-11 23:42 
AnswerRe: URL routing issue asp.net 4.0 Pin
jkirkerx19-Nov-11 19:44
professionaljkirkerx19-Nov-11 19:44 
QuestionI have some queires releated to DataCalendar Pin
Ostwal Aarti18-Nov-11 1:37
Ostwal Aarti18-Nov-11 1:37 
AnswerRe: I have some queires releated to DataCalendar Pin
Blue_Boy18-Nov-11 1:54
Blue_Boy18-Nov-11 1:54 
QuestionMultiple dll's Refrencing Asp.net Website Pin
vishnukamath17-Nov-11 20:14
vishnukamath17-Nov-11 20:14 
QuestionRe: Multiple dll's Refrencing Asp.net Website Pin
Pandya Anil17-Nov-11 22:25
Pandya Anil17-Nov-11 22:25 
AnswerRe: Multiple dll's Refrencing Asp.net Website Pin
Richard MacCutchan18-Nov-11 0:44
mveRichard MacCutchan18-Nov-11 0:44 
AnswerRe: Multiple dll's Refrencing Asp.net Website Pin
jkirkerx19-Nov-11 19:51
professionaljkirkerx19-Nov-11 19:51 
QuestionGet Regional Language settings. Pin
Mugdha_Aditya17-Nov-11 19:56
Mugdha_Aditya17-Nov-11 19:56 
Hello,

I wants to retrive regional language settings in my code. For that i used WMI.

I tried below code.
in page load : GetLoggedInUserCulture();

C#
private static CultureInfo GetLoggedInUserCulture()
{
    string folderName = string.Empty;
    string sID = GetWindowsLoggedInUserSID();
    object locale = Registry.Users.OpenSubKey(sID + @"\Control Panel\International").GetValue("Locale");
    int lCID = int.Parse(locale.ToString(), NumberStyles.HexNumber);
    CultureInfo ci = new CultureInfo(lCID);
    return ci;
}
private static string GetWindowsLoggedInUserSID()
{
    string userName = null;
    string sID = null;
    try
    {
        ManagementScope oMs = new ManagementScope();
        ObjectQuery oQuery = new ObjectQuery("Select UserName from Win32_ComputerSystem");
        ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs, oQuery);
        ManagementObjectCollection oReturnCollection = oSearcher.Get();
        ManagementClass mc = new ManagementClass(oMs, new ManagementPath("ServerBinding"), null);
        foreach (ManagementObject oReturn in oReturnCollection)
        {
              userName = oReturn["UserName"].ToString().ToLower();
        }

            userName = userName.Substring(userName.LastIndexOf(@"\") + 1);
            oQuery = new ObjectQuery("Select SID, Name from Win32_Account where Name = '" + userName + "'");
            oSearcher = new ManagementObjectSearcher(oMs, oQuery);
            oReturnCollection = oSearcher.Get();

            foreach (ManagementObject oReturn in oReturnCollection)
            {
                if (oReturn["SID"] != null)
                {
                    sID = oReturn["SID"].ToString();
                }
            }
    }
    catch (Exception)
    {
        throw;
    }
    return sID;
}



but oReturn["UserName"] and oReturn["SID"] return me null value. Frown | :(

Do i need to add anything in webconfig. or any thing else am missing.. please help me
AnswerRe: Get Regional Language settings. Pin
Bernhard Hiller18-Nov-11 0:59
Bernhard Hiller18-Nov-11 0:59 
AnswerRe: Get Regional Language settings. Pin
jkirkerx19-Nov-11 19:55
professionaljkirkerx19-Nov-11 19:55 
GeneralRe: Get Regional Language settings. Pin
Mugdha_Aditya20-Nov-11 17:38
Mugdha_Aditya20-Nov-11 17:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.