Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

livez

@livez
About
Posts
146
Topics
67
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Oracle 11g Continuous Query Notification to a vs 2005 c# service
    L livez

    Hello! Sadly I never solved it. My subscription was also removed eventhough I set it up to stay (cmd.Notification.IsNotifiedOnce = false;), and I can see with network sniffer that something is sent to my computer from databasecomputer, but my application never registers the callback. I also tried with samplecode from oracle (http://www.oracle.com/technetwork/issue-archive/win06odp-099708.html[^] and http://www.devart.com/dotconnect/oracle/docs/Devart.Data.Oracle~Devart.Data.Oracle.OracleDependency.html[^]) but I experienced same problem with that. I used oracle client 11.2.0.2.0 and my db is running 11.2.0.1.0. I´ve shelved this issue for a while but figured I'd give it another go in a few weeks. If you or anyone else solve this issue I would very much appreciate a reply here, and I will of course do the same. /regards

    modified on Thursday, February 10, 2011 3:53 AM

    Database database csharp oracle visual-studio help

  • Oracle 11g Continuous Query Notification to a vs 2005 c# service
    L livez

    Hello! Im trying to set up a Continuous Query Notification between our oracle database and my c# service, but can´t seem to get it to work. This is the method I have for making the connection:

    private void SubscribeToTable(string tableName)
    {
    Log.Write("Add listener: " + tableName);

            OracleConnection con = DataBase.GetOpenConnection();
            OracleDependency dependency = new OracleDependency();
            dependency.QueryBasedNotification = false;
            OracleCommand cmd = con.CreateCommand();
            cmd.CommandText = "Select \* from " + tableName;
            dependency.OnChange += new OnChangeEventHandler(dependency\_OnChange);
            dependency.AddCommandDependency(cmd);
            cmd.Notification.IsNotifiedOnce = false;
            cmd.AddRowid = true;
            cmd.ExecuteNonQuery();
            con.Close();
            con.Dispose(); 
        }
    

    And when I run this I get a row in user_change_notification_regs with these values:

    42 4 net8://(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.119)(PORT=1521))?PR=0 0 0 49999 WEB.EXPORTEDDOCUMENTS

    and this is the callback event:

    static void dependency_OnChange(object sender, OracleNotificationEventArgs eventArgs)
    {
    Log.Write("Table has been Changed");
    Log.Write(eventArgs.Source.ToString());
    Log.Write(eventArgs.Info.ToString());
    Log.Write(eventArgs.Source.ToString());
    Log.Write(eventArgs.Type.ToString());
    }

    My problem is the callback-event never runs. Has anyone else had this problem?

    Database database csharp oracle visual-studio help

  • How to get first and last date given a year and a weeknr
    L livez

    got it working with your suggestion (with a slight adjustment), thanks!

    C# tutorial question

  • How to get first and last date given a year and a weeknr
    L livez

    Ill try that, thanks!

    C# tutorial question

  • How to get first and last date given a year and a weeknr
    L livez

    "Create a DateTime object with the relevant date" But its the relevant date I dont have. I have a year and a weeknr. How do I create a relevant datetime-object with that?

    C# tutorial question

  • How to get first and last date given a year and a weeknr
    L livez

    Thanks, Ill check it out!

    C# tutorial question

  • How to get first and last date given a year and a weeknr
    L livez

    Hello and thanks for your reply. I don´t see how it would be that easy though. Could you give a pointer of how you would solve my problem with datetime-class? I´ve been trying to use System.Globalization.Calendar with AddWeeks etc, but have yet to make it work.

    C# tutorial question

  • How to get first and last date given a year and a weeknr
    L livez

    Hello! Im trying to figure out how I get the dates for the first and last day of a given year and week. For instance: year: 2009 week:53 = 2009/12/28 - 2010/01/03 year: 2010 week:1 = 2010/01/04 - 2010/01/10 Does anyone know how to achieve this?

    C# tutorial question

  • HttpWebResponse.GetResponse(); The operation has timed-out
    L livez

    Thank you both for your responses! I will try your suggestions.

    ASP.NET xml tutorial question

  • Best way to swap places of controls? [modified]
    L livez

    I would really prefer to do this serverside. Also, the placeholder can contain a number of things, not necessarily a href.

    ASP.NET question com sysadmin data-structures performance

  • Best way to swap places of controls? [modified]
    L livez

    Hello! I´ve got a couple of placeholders like this: asp:PlaceHolder ID="Pl1" runat="server"> <a href="http://www.mypage1.com" target="_blank">Click here</a> </asp:PlaceHolder> asp:PlaceHolder ID="Pl2" runat="server"> <a href="http://www.mypage2.com" target="_blank">Or click here</a> </asp:PlaceHolder> asp:PlaceHolder ID="Pl3" runat="server"> <a href="http://www.mypage3.com" target="_blank">or Click here</a> </asp:PlaceHolder> Depending of a couple of things I want to swap places between the placeholders. What is the best way to do this, performance-wise? I´ve had a solution where I remove placeholders and put them back in the controll-tree in the order I want them to be in, but this does not feel so efficient. Is there some other way? /regards

    modified on Thursday, September 24, 2009 10:30 AM

    ASP.NET question com sysadmin data-structures performance

  • HttpWebResponse.GetResponse(); The operation has timed-out
    L livez

    Hello! We run this code to get xml for an example from uri´s try { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(requestUriString); webRequest.Timeout = timeOut; HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); return new StreamReader(webResponse.GetResponseStream(), encoding); } catch(WebException e) { LogError(e); return null; } We keep getting alot of "The operation has timed-out"-exceptions thrown. Is there something we are missing when we are setting up the webRequest object? For instance, should we set ReadWriteTimeout? /regards W

    ASP.NET xml tutorial question

  • Problems with embedding images in system.net.mail.mailmessage
    L livez

    Thanks for your response! I tried just having the faulty image in a div instead, but it didn´t work :( EDIT: My mistake u were absolutely right. There wasnt enough room for the image, thats why it was sent as an attachment. Thanks alot!

    modified on Tuesday, August 18, 2009 4:37 AM

    C# csharp html question

  • Problems with embedding images in system.net.mail.mailmessage
    L livez

    Hello! Some of the images I try to embedd do not show up in my email, but are instead sent as attachments. I can´t figure out why some are working and some arent. This is how I embedd images: MailMessage mail = new MailMessage(); string imagePath = System.Windows.Forms.Application.StartupPath + "\\pathToImages"; LinkedResource resource1 = new LinkedResource(imagePath + "\\head21.jpg", System.Net.Mime.MediaTypeNames.Image.Jpeg); resource1.ContentId = "head21.jpg"; LinkedResource resource2 = new LinkedResource(imagePath + "\\border.jpg", System.Net.Mime.MediaTypeNames.Image.Jpeg); resource2.ContentId = "border.jpg"; StringBuilder content = new StringBuilder(); .... content.Append(string.Format("<td width=600 align=left><img border=0 align=center src=\"cid:head21.jpg\" width=600 height=57></td></tr></tbody></table></td></tr></tbody></table>")); .. content.Append(string.Format("<td><img alt=\"\" src=\"cid:border.jpg\" width=560 height=21></td></tr></tbody></table></td>")); .. string body = Mail.CreateHtmlFromTemplate(content.ToString(), string.Empty, null); AlternateView htmlView = AlternateView.CreateAlternateViewFromString(body, null, MediaTypeNames.Text.Html); htmlView.LinkedResources.Add(resource1); htmlView.LinkedResources.Add(resource2); Here resource1 works fine, and shows up in body of email. Resource2 is instead sent as attachment and does not show up in the email. Does anyone have any idea why this is?

    C# csharp html question

  • Problems with caching datatable
    L livez

    Thank you very much for your responses, I shall try your suggestions ( and check out that article ) first thing I do when I arrive at work tomorrow. /Regards

    ASP.NET help performance question

  • Problems with caching datatable
    L livez

    My cached datatable:

    private static DataTable MyTable
    {
    get
    {
    object obj = HttpContext.Current.Cache[SiteCacheEntries.MyTable];
    if (obj == null)
    {
    DataTable dt = Data.Specific.GetMyTable();

    		DateTime nextMorning = DateTime.Now.Hour < 6 ?
    			new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 6, 0, 0) :
    			new DateTime(DateTime.Now.AddDays(1).Year, DateTime.Now.AddDays(1).Month, DateTime.Now.AddDays(1).Day, 6, 0, 0);
    				
                        HttpContext.Current.Cache.Insert(SiteCacheEntries.MyTable, dt, null, nextMorning,    Cache.NoSlidingExpiration); 
    				return dt;
    	}
    	return (DataTable)obj;
    }
    

    }

    Dataview is also cached:

    public static DataView MyDataView
    {
    get
    {
    object obj = HttpContext.Current.Cache[SiteCacheEntries.MyDataView];
    if (obj == null)
    {
    DataView dv = new DataView(MyTable);

                    HttpContext.Current.Cache.Insert(SiteCacheEntries.MyDataView, dv, null, DateTime.Now.AddYears(10), Cache.NoSlidingExpiration);
                    return dv;
                }
                return (DataView)obj;
            }
        }
    

    My method to collect data from table

    public static string GetPageConstant(PageConstants type, LanguageCode lang)
    {
    MyDataView.RowFilter = string.Format("{0} = '{1}' AND {2} = '{3}'", _nameOfTypeColumn,
    typeColumn.ToString(), _nameOfLanguageColumn, lang);

                if (MyDataView.Count > 0)
                {
                    return MyDataView\[0\].Row\[\_nameOfValueToCollectColumn\].ToString();
                }
    
                return string.Empty;
            }
    

    And its in the GetPageConstant method the error occurs.

    modified on Monday, August 3, 2009 10:06 AM

    ASP.NET help performance question

  • Problems with caching datatable
    L livez

    Hello! I cache a System.Data.Datatable (which I create with lazyloading) containing urlrewriting information. I then use a method looking like this:

    string GetDataFromTable(MyEnum enum)

    The method creates a system.data.dataview pointing at the table with the enum as rowfilter and returns a few values from the view. My problem is, sometimes when the method is run it generates an error like this: "The given key was not present in the dictionary." since my enum only contains a few values and I know for a fact that all enum-values are represented in the table, this error should not be able to occur. As I see it the problem must therefore be either with the caching or something with the memory. Has anyone else experienced this problem or have an idea how I approach this? /Regards!

    ASP.NET help performance question

  • yahoo blocks my system.net.mail! [modified]
    L livez

    Good suggestions, but I believe both are already taken care of. Our smtp is not open relay, and I think I attach a valid return address by doing this: myMail.From = new MailAddress("info@myCompany.com", "MyCompany");

    ASP.NET csharp question

  • how to show bold words.
    L livez

    put each matching word inside a span with css of your choice. searchword: dog I want a dog for christmas becomes I want a <span class="makeMeBold">dog</span> for christmas

    ASP.NET csharp css asp-net help tutorial

  • yahoo blocks my system.net.mail! [modified]
    L livez

    Hello all I send automatically generated emails from my page for verification etc. I´ve read a couple of articles on the subject of avoiding spamfilters, and the mails work fine with hotmail, gmail, gmx and so on. But for some reason yahoo is tagging my mail as spam. Does anyone know if yahoo demands some sort of extra attention in order to pass spamfilter, and if so what this might be? /regards

    modified on Wednesday, June 3, 2009 7:34 AM

    ASP.NET csharp question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups