|
I'm fine if I need to write:
cell.Value.Contains(s) or something similar in the Cells class. I know I need to do some changes in the Cells class.
I'm just wonder if I, in the Main()-method, can pass an argument in the foreach-loop condition, just like I stated it.
|
|
|
|
|
Have a look at the AsQueryable() extension method.
See here.
|
|
|
|
|
|
If you want to be able to do
foreach (Cell cell in cells.HavingColumn("B")) {
Console.WriteLine(cell.Value);
}
all you have to do is add a method HavingColumn(string columnName) to the Cell class, which returns a
System.Collections.IEnumerable or a System.Collections.IEnumerable<T=Cell> ; one way of implementing that is by creating a List<Cell> .
FWIW1: this operation will be more expensive than simply adding a test inside your foreach; which is how the method will be implemented anyway (but then it is hidden from the external world).
FWIW2: and that must be how LINQ does it; the easiest and most expensive approach.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
hi,
i am using api
GetPrivateProfileString(string section,
string key, string def, string retVal,
int size, string filePath);
which is not working for me but if i declare 4th arguement as stringBuilder then it works fine but i want to keep it string.wat to do?
|
|
|
|
|
Strings are immutable - this is a return parameter so you must supply a changeable type. You just convert from StringBuilder to string via StringBuilder.ToString when you need it.
I would suggest though, that you look at .NET app.Config files instead, as .INI files are a little old style...
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in.
Apathy Error: Don't bother striking any key.
|
|
|
|
|
Whenever I use P/Invoke I write a method to wrap the API method:
[
System.Runtime.InteropServices.DllImportAttribute
(
"Kernel32"
,
SetLastError=true
,
EntryPoint="GetPrivateProfileString"
)
]
private unsafe static extern uint
API_GetPrivateProfileString
(
string lpAppName
,
string lpKeyName
,
string lpDefault
,
byte* lpReturnedString
,
int nSize
,
string lpFileName
) ;
public unsafe static int
GetPrivateProfileString
(
string lpAppName
,
string lpKeyName
,
string lpDefault
,
out string lpReturnedString
,
int nSize
,
string lpFileName
)
{
int result ;
byte[] temp = new byte [ nSize ] ;
fixed ( byte* ptemp = temp )
{
result = (int) API_GetPrivateProfileString
(
lpAppName
,
lpKeyName
,
lpDefault
,
ptemp
,
nSize
,
lpFileName
) ;
}
lpReturnedString = System.Text.Encoding.Unicode.GetString ( temp ).Substring ( 0 , result ) ;
return ( result ) ;
}
I wrote this for someone else when I was just learning C#, I don't use it. I use XML for configuration files.
|
|
|
|
|
Dear all,
Im new in this and hope to get some advice.
I have to send a datatable through soap to a soap server.
Can anyone give me some hints/references of how to do that?
Thanks in advance.
|
|
|
|
|
To send data over SOAP, you need to construct a web service and then call an exposed method in that web service.
I think you should start by reading a book on web services.
You can take a look at this article also.
|
|
|
|
|
hi everyone,
In the project am working on i have list of user which i can select multiple user and then click on print form or card
for form it is already done all am doing is to build the table inside a string then pass it the the following JavaScript
function printDiv() { <br />
var ToEdit1 = document.getElementById('ListParticipantsUC1_hdnToPrint').value;<br />
var ToEdit2 = ToEdit1.replace(/="/g, "'"); <br />
var ToPrint = ToEdit2.replace(/</g,"<");<br />
var WinPrint = window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');<br />
var report = '<head><META name="WebPartPageExpansion" content="full"><META name="WebPartPageExpansion" content="full"><META name="WebPartPageExpansion" content="full">';<br />
report = report + '<link href="includes/En/print.css" type="text/css" rel="stylesheet" media="print,screen"/></head>';<br />
report = report + '<style>.break { page-break-before: always; }</style><body><table width="100%">';<br />
report = report + '<tr><td>';<br />
WinPrint.document.write(report + ToPrint + '</td></tr></table></body>');<br />
WinPrint.document.close();<br />
WinPrint.focus();<br />
WinPrint.print();<br />
WinPrint.close(); <br />
}
but when it came to print the card i had to add table on the page because it contain 4 images that i read from database, so after filling all the information including the images, i render the whole page and save it to a string and pass it as the form
StringWriter sw = new StringWriter();
HtmlTextWriter w = new HtmlTextWriter(sw);
areaToPrint.RenderControl(w);
HtmlCode = HtmlCode + sw.GetStringBuilder().ToString();
but i cannot control its position or anything at print time
any suggestions or new methods to print the card
|
|
|
|
|
hi all,
i have a windows application project and a team contains 3 developer, i want to use vss to make the project available for each developer, and each developer changes and errors not shown to another.
thanx all.
|
|
|
|
|
I have a vague feeling that this might be close to what you are looking for: Visual SourceSafe 2005 - Sharing and Branching [^]
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
You will need to obtain licenses / buy VSS.
You can then go through this link.
|
|
|
|
|
hi
i use it but the problem is :
if any developer change the code the yes to all message shown to other developers. it means the vss not manage it.
can you help me to solve this problem.
thanx alot
|
|
|
|
|
Where is your code stored? If it's on a network share, all developers will see the same thing.
In order to setup vss, you should:
- assign userids to each developer (through vssadmin)
- create the initial branch of your project, and upload the current version.
- each developer should now select a local working directory for that project, and check out or retrieve the current version of files, and work on his local copy.
- when they feel the code is complete, the should check-in their code for others to see.
I have the impression that you are not very experienced with SCCMs. You may want to read this[^].
|
|
|
|
|
hi
i have a note, we are not work on network sharing, but work on one server as terminal remote users.
is this way make a problem.
thanks all
|
|
|
|
|
In that case, the working directory of the users should be under their profile. (for instance My Documents).
|
|
|
|
|
hi
i define 3 users (developres) from vss administration, but i don't know how to set a working folder for each one,
can u help me?.
thanks all
|
|
|
|
|
The should do it themselves. When they log on to vss (not vssadmin), they can view projects which are already established. Each project has a working directory, which can be set for the individual user. (Have a dig around, I don't use vss any more). When a user first does a recursive 'get' on a project, the directory will be set automatically.
Note that vss will soon be leaving the supported status at Microsoft. No updates will be done any more on the product. If you want a well-supported, free source code control system which is similar to vss (but more powerful), you may want to investigate subversion[^].
If you want to stick to Microsoft kit, have a look at Team Foundation Server[^]. (can be pricey, depending on how you buy Visual Studio and/or msdn subscriptions.
|
|
|
|
|
hi
i'm create a working folder for each user, but when i click check out on form and change its design(like add button on it)
the other users see the message "this file has been modified out side of the source editor. Do you want to reload it?
and this message has 4 button options(yes,yes to all,no,no to all).
can u help me.
thank you
|
|
|
|
|
You should really read up on source control.
Installing a source control system (especially for multiple users) is something that requires careful planning, testing, and most important a strategy.
If you think you can do all these things in a couple of hours, with no previous experience, and without understanding the concepts, you will soon find out that developers are loosing source code, and you may even lose your existing codebase. Everybody will be mad at you.
You should set out a policy for branching, for checking out, checking in, archiving. Most important of all, you should TRAIN your developers in the use of the tool and the application of policies.
Now to get back to your current problem: your users are still looking at the same working copy of the file.
Please, pretty please, read the documentation I pointed you towards and don't bother your users until you've understood everything you are doing ON A TESTBED, and have some solid guidelines ready for them before they start using the system. In large development shops, administering the source control is a specialised job. Don't think you can learn in a couple of hours.
|
|
|
|
|
Hello everybody,
How to acquire the set of ip addresses in a network dynamically? i.e. is it possible to write a program to get the ip addresses of all computers in a network?
Any help is greatly appreciated.
Thanks in advance.
Best regards,
C. Beulah
|
|
|
|
|
|
It would be helpful if you stated your requirements somewhat more clearly. What do you mean by network? Your home network? A corporate network? An ASN? The Internet?
Also tell us for what purpose you want to use this data, because I have a gut feeling that you are approaching this the wrong way...
|
|
|
|
|
i m trying to connecting the excel sheet with C# application but getting the error
"External table is not in the expected format."
i have written the following lines of code
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;
public partial class excelform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string conn = ("Provider=Microsoft.Jet.OLEDB.4.0;" +
("Data Source=" + Server.MapPath("excelsht.xlsx") +
";Extended Properties=\"Excel 8.0;\""));
string SSQL = "SELECT * from [excelsht$]";
OleDbDataAdapter oleDA = new OleDbDataAdapter(SSQL, conn);
DataSet ds = new DataSet();
oleDA.Fill(ds);
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}
}
|
|
|
|
|