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
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
Yes, i will do that as well. But it would be nice to have both solutions :)
Andreas Johansson
Senior software developer at Tieto Sweden
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
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
I know X| Looks like thats my only way out.
Andreas Johansson
Senior software developer at Tieto Sweden
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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