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
A

Andreas X

@Andreas X
About
Posts
62
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Manipulating taskbar right click applicatin menu
    A Andreas X

    This page: http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx tells how to do it properly

    Andreas Johansson
    Senior software developer at Tieto Sweden

    C# question

  • Manipulating taskbar right click applicatin menu
    A Andreas X

    Yes, i will do that as well. But it would be nice to have both solutions :)

    Andreas Johansson
    Senior software developer at Tieto Sweden

    C# question

  • Manipulating taskbar right click applicatin menu
    A Andreas X

    Hi! I need to remove Application launch and "Pin this application to taskbar" from the taskbar context menu for an application. Reason is that the application cannot start standalone, it must be feed with information from another application. Does anyone know how?

    Andreas Johansson
    Senior software developer at Tieto Sweden

    C# question

  • Count the unique number of words inside a string builder(Not letters...Words))
    A Andreas X

    Something like this?

    StringBuilder sb = new StringBuilder();
    sb.Append("hi friends hi");

    Console.WriteLine("Count is " + "".ToString().Split(new []{" "}, StringSplitOptions.RemoveEmptyEntries).
    Where(w => w.Equals("hi", StringComparison.CurrentCultureIgnoreCase)).Count();

    Andreas Johansson
    Senior software developer at Tieto Sweden

    C# tutorial

  • Extending wpf print dialog
    A Andreas X

    I know X| Looks like thats my only way out.

    Andreas Johansson
    Senior software developer at Tieto Sweden

    WPF csharp wpf data-structures question

  • Extending wpf print dialog
    A Andreas X

    Thank you for your reply. I have already found those articles and posts but they all work with the windows forms version of the printDialog. I cant figure out how to apply the technique to the presentationframework PrintDialog.

    Andreas Johansson
    Senior software developer at Tieto Sweden

    WPF csharp wpf data-structures question

  • The best way to display live log output to a WPF windows.
    A Andreas X

    I would bind a property containing the messages, perhaps a subset of messages, to a multiline textbox.

    Andreas Johansson
    Senior software developer at Tieto Sweden

    WPF csharp wpf wcf performance help

  • Extending wpf print dialog
    A Andreas X

    Hi! I have been looking for a way to extend the default printdialog in PresentationFramework. I need to filter the available printers some how. Does anyone know if it is possible either to filter the printer queue datasource or to extend the dialog to add such functionallity?

    Andreas Johansson
    Senior Software developer at Tieto Sweden

    WPF csharp wpf data-structures question

  • Return List<> on button click of user control.
    A Andreas X

    i would create an interface that contains the method to update the page gridview.

    public interface IMyInterface
    {
    public void UpdateGridview(ftExclusionsList theList);
    }

    implement the interface on the page.

    protected void btnUpdate_Click(object sender, EventArgs e)
    {
    ftExclusionsList myFTExclusionList = new ftExclusionsList();
    foreach (ListItem li in cblExclusions.Items)
    {
    if (li.Selected == true)
    {
    ftExclusions myftExclusion = new ftExclusions();
    myftExclusion.excluId = Convert.ToInt32(li.Value);
    myftExclusion.excludesc = li.Text.ToString();
    myFTExclusionList.Add(myftExclusion);
    }

        }
        selectedExclusions = myFTExclusionList;
        // how do I return this list and bind it with gridview on calling page?
        ((IMyInterface)this.Page).UpdateGridview(selectedExclusions);
    }
    

    this is the way i do it and i works like a charm :)

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    ASP.NET question design tutorial

  • Online tutorial with examples
    A Andreas X

    http://www.asp.net/[^] Try Google, there are multiple numbers of tutorials out there.

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    ASP.NET csharp asp-net tutorial

  • How to pass username and password between sites?
    A Andreas X

    If you encrypt your data before puttning it into the query string, i think this is the best way. you can encrypt using the following method:

    public static string Encrypt(string originalString)
    {
        if (String.IsNullOrEmpty(originalString))
        {
            throw new ArgumentNullException("The string which needs to be encrypted can not be null.");
        }
    
        DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();
        MemoryStream memoryStream = new MemoryStream();
        CryptoStream cryptoStream = new CryptoStream(memoryStream, cryptoProvider.CreateEncryptor(privateKey, privateKey), CryptoStreamMode.Write);
    
        StreamWriter writer = new StreamWriter(cryptoStream);
        writer.Write(originalString);
        writer.Flush();
        cryptoStream.FlushFinalBlock();
        writer.Flush();
    
        return Convert.ToBase64String(memoryStream.GetBuffer(), 0, (int)memoryStream.Length);
    }
    

    where privateKey is a byte[] of choice.

    private static byte[] privateKey = ASCIIEncoding.ASCII.GetBytes("#privateKey#!!#");

    or something like that.

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    ASP.NET help question database tutorial

  • how to search on homepage of respective item?
    A Andreas X

    Hi! I want to help you, but i'm reading your question over and over, and i can't understand what you are trying to do.

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    ASP.NET csharp asp-net database design sysadmin

  • Insert opertion doesn't work
    A Andreas X

    You wrote:

    namespace DAL
    {
    public class DALCustomerEntery
    {
    NorthwindMapping.NorthwindDataContext xy = new NorthwindMapping.NorthwindDataContext();

    public void InsertData(Customer objCustObj) //this object is coming from BOL
    {

    NorthwindMapping.Customer cust= new NorthwindMapping.Customer();

    cust.CustName = objCustObj.Custname;
    cust.amount = 25.89D;
    cust.Companyname = "My company";
    cust.Checkin = DateTime.Now;
    cust.Checkout = DateTime.Now;

    xy.Customers.InsertOnSubmit(cust);

    xy.SubmitChanges();

    }

    }
    }

    try to move the row NorthwindMapping.NorthwindDataContext xy = new NorthwindMapping.NorthwindDataContext(); into the InsertData Method

    namespace DAL
    {
    public class DALCustomerEntery
    {

    public void InsertData(Customer objCustObj) //this object is coming from BOL
    {
    NorthwindMapping.NorthwindDataContext xy = new NorthwindMapping.NorthwindDataContext();
    NorthwindMapping.Customer cust= new NorthwindMapping.Customer();

    cust.CustName = objCustObj.Custname;
    cust.amount = 25.89D;
    cust.Companyname = "My company";
    cust.Checkin = DateTime.Now;
    cust.Checkout = DateTime.Now;

    xy.Customers.InsertOnSubmit(cust);

    xy.SubmitChanges();

    }

    }
    }

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    LINQ sales help

  • Insert opertion doesn't work
    A Andreas X

    Have you tried to instansiate the DataContext object within the method?

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    LINQ sales help

  • How to get configuration file's path
    A Andreas X

    Hi! You need to use the executing assembly's configuration file even for the library.

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    ASP.NET csharp asp-net help tutorial question

  • Model PopUp Problem
    A Andreas X

    Hi! Make sure that you modalpopup is placed in an updatepanel which has not got chlidrenastrigger. You have to ensure that the control that causes the popup is not reloaded with the postback.

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    ASP.NET css help announcement

  • GridView Edit
    A Andreas X

    Hi! You should try to use a ModalPopupExtender from Ajax Toolkit to show the data that you want to edit. This way your page will not change state and the view will remain as it was when you clicked on the row.

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    ASP.NET css announcement

  • Insert opertion doesn't work
    A Andreas X

    Hi! Have you got the primary keys defined correct in the dbml file?

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    LINQ sales help

  • need help getting results of a dynamic sproc to appear in Linq strongly defined
    A Andreas X

    Hello! When i have similar situations i usually create a dummy SPROC that returns only empty data with the correct datatypes for each column. like:

    select
    CAST(0 as int) as CustomerNumber,
    CAST('x' as nvarchar(64)) as CustomerName, .......

    and then comment all dynamic data in the SPROC. Then you can drag the SPROC into the dbml to get the correct return type. Once you hava a correct return type. restore your SPROC to the correct state. hope it helps

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    LINQ database csharp linq help question

  • how to get next row value
    A Andreas X

    I think this is a perfect case for the modulus operator.

    DataContext db = new DataContext();
    for(int month = 1; month <= 12; month++)
    {
    DataEntry de = new DataEntry();
    de.ID = 1;
    de.venuelID = 21;
    de.VOM = (month % 1) == 0;
    db.DataTable.InsertOnSubmit(de);

    DataEntry de = new DataEntry();
    de.ID = 10;
    de.venuelID = 92;
    de.VOM = (month % 2) == 0;
    db.DataTable.InsertOnSubmit(de);
    
    
    DataEntry de = new DataEntry();
    de.ID = 21;
    de.venuelID = 102;
    de.VOM = (month % 3) == 0;
    db.DataTable.InsertOnSubmit(de);
    

    }
    db.SubmitChanges();

    Is this what you want or have i missunderstod?

    Andreas Johansson
    IT Professional at Office IT Partner i Norrbotten Sweden
    What we don't know. We learn.
    What you don't know. We teach

    LINQ csharp database linq help tutorial
  • Login

  • Don't have an account? Register

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