|
Hi All,
I have just confirmed that this is the problem. I manually installed SQL Compact on the test machine and my app runs.
I've followed MicroSoft's instructions to the letter for distributing a local copy of SQL Compact with my application. What would be causing my app to ignore the local dll and crash becuase it can't find the dll in the GAC?
Should I be changing the Reference Properties setting 'Alias' from 'global' to 'local' or something like that?
TIA,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
hi all
i'm using C# to process and send mails to recepients using SMTP, lately i've been requested to add functionality to my code where i'll be able to resolve outlook distribution lists into their respective mail addresses.
as i'm restricted to C# i cannot do this via MAPI, i've tried googling the solution but cannot find a solution that will return the resolved mail addresses. i'll also add i cannot use the Redemption library (can't use anything unless i wrote it in house)
|
|
|
|
|
Hi
I am very new to C# programming (classic asp trained) so please bear with me if I'm being stupid!
All I want to do is declare a 2 dim array but it will be dynamic as I don't know what the size will be. I have been searching the web and it looks like I should be using ArrayList(). However, I cannot find any examples as to how I declare it - it doesn't like the first line in my code as it's looking for a size:
e.g
ArrayList itemsArray = new ArrayList[,];
itemsArray[0,0].Add(TextBox1.Text);
itemsArray[0,1].Add(TextBox2.Text);
Response.Write(itemsArray[0,0]);
Response.Write(itemsArray[0,1]);
Please help as I've been spending hours looking for an answer and about to change career!
|
|
|
|
|
I would use a generic list instead. What type of data/object is going in the first indexer?
Dave
|
|
|
|
|
Hi Dave
Thanks very much for your prompt reply. I have discovered that the ArrayList can only be used for single dimension arrays but it can be used to store objects. Anyway, I've since tried a simple hash table and I managed to add and retrieve values but need to store the hashtable in a session but it refuses to let me retrieve the values - I have posted another question on this about 5 mins ago! I'm on a roll now I see I don't have to wait long to get an answer - perhaps I will stay with programming for now anyway
Thanks
Lorna
|
|
|
|
|
Member 3402886 wrote: perhaps I will stay with programming
Stay with it, it's very rewarding IMHO.
I only do WinForms not ASP.net so I'm not sure about storing values in a session.
From your other post it appears you need a list of 2 strings. This can be done many ways. A dictionary is probably the way to go Dictionary<string, string> myDictionary = new Dictionary<string, string>(); . Alternatively, you can create your object with two string properties and create a List<t> of instances of that.
Dave
|
|
|
|
|
There are different ways of approaching the issue.
What I tend to do is use a list that contains a list as it is more efficient.
However an ArrayList is also fine if you are not too bothered with getting the best performance.
The trick lies in how you retrieve the data.
What you need to do is cast the result from your ArrayList into an Arraylist which you can then work with.
We declare an our main ArrayList:
ArrayList OuterList = new ArrayList();
We then declare our internal ArrayLists adding some data to the ArrayList:
ArrayList InnerList = new ArrayList();
InnerList.Add("SomeData")
InnerList.Add("SomeMoreData")
Then we add InnerList to OuterList so in effect we have an ArrayList of ArrayLists
OuterList.Add(InnerList);
Now the magic comes in extracting the InnerList ArrayLists from OuterList.
We do this by explicitly casting InnerList as an ArrayList as follows:
ArrayList InnerList = (ArrayList)OuterList[Idx];
We can then iterate through InnerList pulling all the elements out.
You will need to play with this code to get it to do exactly what you want - it is just for illustrative purposes.
Also there will be better ways of doing things (as this is expensive processor-wise) - it's more a case of if you can grasp the concept of boxing and unboxing(casting) you will have one more very useful bit of C# under you belt.
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
modified on Monday, June 30, 2008 11:47 AM
|
|
|
|
|
How to avoid duplicate items from the list?
for example consider
list contains 1,2,1,2,3,1,3,1,4,1,2,1,4
actually i want only ones that item placed in list(1,2,3,4) others want to be removed. it is possible? then How?
|
|
|
|
|
What type of list is it? The easiest way is not to allow duplicates in the first place when populating the list by using the Contains method if your list type has one (or similar).
Dave
|
|
|
|
|
i have list[structure] named list[intpoint].
intpoint contains x and y values.
i wants the idle values of x and y. not the repeated values.
i want to remove the duplicated value of x and y in list[intpoint].
how it is possible?.
|
|
|
|
|
List<intpoint> pointList = new List<intpoint>();
if (!pointList.Contains(intPoint))
{
pointList.Add(intPoint);
}
</intpoint></intpoint>
hope will help
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
As I said avoid adding duplicates initially. This code will attempt to add Point(1,1) ten times but the list will only contain the one entry.
List<Point> listPoint = new List<Point>();
Point pointToAdd;
pointToAdd = new Point(1, 1);
for (int i = 0; i <= 10; i++)
{
if (!listPoint.Contains(pointToAdd))
{
listPoint.Add(pointToAdd);
}
}
Console.WriteLine(listPoint.Count);
If you really need to remove, I think the way is to create a new 'clean list' by iterating through the current list, checking before adding to the new list and then assigning the clean list to the old one.
List<Point> CleanList(List<Point> listPoint)
{
List<Point> cleanList = new List<Point>();
foreach (Point currentPoint in listPoint)
{
if (!(cleanList.Contains(currentPoint)))
{
cleanList.Add(currentPoint);
}
}
return cleanList;
}
Then you can simply call listPoint = CleanList(listPoint);
Dave
|
|
|
|
|
|
The free PowerCollections [^]
library has methods for this kind of thing. It's very easy to use if you're already comfortable with generic collections (which you should be if you're using .NET 2 or higher).
Kevin
|
|
|
|
|
i want develop point of sale pay roll system.please give me examples
|
|
|
|
|
hi
In a Forum we Help people Who got Stuck while Attempted to do something. You did not Attempt anything and you did not Attempt to make a reseasrch on Google on what is needed to build a POS System. please Next time Google before you ask Questions or else you will get negavite answers from other members
http://www.google.co.za/search?hl=en&q=How+to+Build+a+Pos+System+in+C%23&meta=[^]
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
who the hell do you think you are??
we WILL NOT do your work for you! this forum is for help on specific issues you encounter, not for you to demand code.
please read THIS[^] before you post here again... then you might get a helpful answer. if you don't you'll only get shouted at again
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
i was shocked when i looked at your previous posts in this forum, so i decided to to give you some step by step pointers
1. Learn to speak English, its not my first language either, but there is nothing hard about it.
2. Get off your ass and try doing something yourself! no one here or anywhere else will do your work for you
3. Buy some programming books and read them.
4. learn some manners, don't demand that we send you code
this is guaranteed to work, you will become a great programmer if you follow this guide. but somehow i doubt that you will
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi
In my C#.net Inventory application in my contact us form I want to place our company website name and when clicked, it must be opened in a web page
Thanks & Regards
modified on Monday, June 30, 2008 7:29 AM
|
|
|
|
|
Hi
Take time and Explain Exacly what you want.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Add a LinkLabel in the designer or through code.
Set Text and Tag properties in the designer or in code:
linkLabel1.Text = "Code Project";
linkLabel1.Tag = "www.codeproject.com";
Add a Click event handler to your LinkLabel and in it put:
System.Diagnostics.Process.Start((string)linkLabel1.Tag);
Dave
|
|
|
|
|
I didn't think of that type of concept for the Tag property.
kudos
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Hi,
I have a gridview, with a rowcommand. When I try to debug I can see it dosn't call the rowCommand (DeleteImage) Please can anyone tell me, why it does not run that rowCommand?
my code:
<asp:GridView ID="grdImages" runat="server" AutoGenerateColumns="false"
AutoGenerateEditButton="false" BorderColor="Transparent"
CellPadding="2" GridLines="vertical"
CellSpacing="0" DataKeyNames="filename"
ForeColor="Black"
ShowHeader="false" onsorting="grdImages_Sorting"
onrowcommand="grdImages_RowCommand">
<RowStyle BorderStyle="Dotted" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<img src='<%#Eval("imgImage")%>' alt="Image" width="50px" height="50px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="filename" runat="server" Text='<%#Eval("filename")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Button CssClass="buttonsSmall" ID="btnDeleteImage" OnClientClick="return confirm('Billedet vil ikke længere kunne vises på livesitet. Er du sikker på, du vil slette billedet?');" Font-Size="8pt" runat="server" Text="Slet" CommandName="DeleteImage" CommandArgument='<%# Eval("filename")%>' />
</ItemTemplate>
<HeaderStyle />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="rowcolor" />
<AlternatingRowStyle CssClass="alternatingrowcolor" />
</asp:GridView>
protected void grdImages_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteImage")
{
int imagename = Convert.ToInt32(e.CommandArgument);
string imagepath = Convert.ToString(Session["uploadpath"]);
File.Move(imagepath + '/' + imagename, Constants.ImageRecycleBin.UploadPath + imagename);
LoadImages(Convert.ToString(Session["uploadpath"]), "filename", "ASC");
}
}
Said with other words, when I hit the button in the gridview only the javascript event fires, not the RowCommand. I have tried to remove the javascript event with no success......
Kind regards,
simsen
|
|
|
|
|
DOHHHHHHH..... In my pageload event I updated the gridview without a (!IsPostBack).........
|
|
|
|
|
Hi guys,
I'm working on a c# tool to batch some compilation of different c++ projects
So evrything work fine except that I can't redirect the standard output for this command (it works for a simple dir c
For ex, this the code I use:
Process p = new System.Diagnostics.Process();
p.StartInfo = new ProcessStartInfo();
p.StartInfo.FileName = @"make.exe";
p.StartInfo.Arguments = "BUILD=release";
p.Start();
This works and open a cmd window
But I need to output the result in my c# app but when I enable the standard redirection like this
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
The process get stucked (the make process is started but it doesnt seem to do anything)
I have a do/while like this
do
{
if (!p.HasExited)
{
p.Refresh();
Console.WriteLine(" total processor time: {0}",
p.TotalProcessorTime);
}
} while (!p.WaitForExit(1000));
In fact the processor time is always null (0)
I also try these options but no more results:
p.EnableRaisingEvents = true;
p.StartInfo.CreateNoWindow = true;
Any ideas ???
Thanks in advance !
|
|
|
|