|
Thank you so much for the reply.
However, Sean's answer was exactly what I was looking for.
-----------------------------------------------------------
Completion Deadline: two days before the day after tomorrow
|
|
|
|
|
If you don't need the results of the Split for something else then mine is likely more efficient.
Here it is with the Conditional Operator:
int d ;
args [ 0 ] = args [ 0 ].Trim( new char[] { '0' } ) ;
System.Console.WriteLine
(
( d = args [ 0 ].IndexOf ( '.' ) ) == -1 ? 0 : args [ 0 ].Length - d - 1
) ;
|
|
|
|
|
A similar question was asked in the microsoft.public.dotnet.languages.vb newsgroup two days ago. Here's the code that I suggested, converted to C#, and assuming that the decimal separator is a period:
int pos = text.IndexOf('.');
int decimalCount;
if (pos == -1) {
decimalCount = 0;
} else {
decimalCount = value.Length - pos - 1;
}
It's about ten times faster than splitting the string.
If you want it in few lines:
int pos = text.IndexOf('.');
int decimalCount = (pos == -1) ? 0 : value.Length - pos - 1;
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello All,
My Problem Is I Have A Ledger Which Have Values Like:
jan feb mar april may june july...... dec
Ajay 0 1 2 0 10 8
Anu 0 55 54 88 45 77 ......
...
..
Now These are marks of students in a particular subject for everymonth
Teacher has to enter these marks in the matrix way as i shown above.
I m Unable to FInd ne such control in asp.net
Editable grid doesnt work for me. as i cant fill any garbage data in any table.
Any suggestions? I m in terrible situaton.
Please Help me.
(I m A Novice)
Thanks To ALL
Sanchit Jain
|
|
|
|
|
If the only thing preventing you from using the standard grid is that any old garbage data can be put in it, why not do some client-side or server-side validation of the data?
p.s. this question might be better asked in the ASP.NET forum.
|
|
|
|
|
hi all,
is there a(ny) way to check whether a cell value is empty or not ?
when i try to do (for an empty cell): string.isnullorempty(datagridview.rows[i].cells[j].value.tostring());
i get this error: object reference not set to an instance of an object.
i'd like to know if there is any solution for my problem.
thanks in advance.
MFA
|
|
|
|
|
Try this: string.IsNullOrEmpty(datagridview.rows[i].cells[j].value as string);
|
|
|
|
|
You can use this rather
datagridview.rows[i].cells[j].Text
Paras Kaneriya
|
|
|
|
|
I need to perform an action if I drag to an area outside of the control being dragged from. Namely an error message and a return. I can't figure out how to do this.. help! pleeeeze and thank you 
|
|
|
|
|
You could Capture the mouse using theControl.Capture = true. This way, I believe you'll get drag and drop events even if your mouse is outside of the control.
I'm not certain it will actually work, however. Might be worth looking into.
Outside of crazy capture the mouse schemes, I don't know that this can be done within the confines of the .NET framework.
|
|
|
|
|
when the connection is successfully connected (means if only the user logged into the sql server)need to show the message "successfully logged on".
not just the connection opened before the server validate the user.
could any one help me with this..
|
|
|
|
|
MessageBox.Show("Successfully logged on");
|
|
|
|
|
You won't get an open connection if the user (info) is invalid. Or are you seeing something else?
|
|
|
|
|
Our organization is currently developing an SDLC process for managing development projects. Would anyone be willing to share what your organization is currently doing?
What we are looking for is when our development department is approached with a project, we want to first deliver to the requestor an SDLC type statement of work where everything is outlined and the proceedure that we will follow.
Before going throught the hassle of creating ours from cradle to grave I was hoping to see what others have already created?
Thanks in Advance
|
|
|
|
|
fuziononline wrote: Before going throught the hassle of creating ours from cradle to grave I was hoping to see what others have already created?
So your hoping to see our C# implementations of SDLC?
|
|
|
|
|
More specifically I work in a application design department that designs in c#. They have just now decide to provide application development and are now in the process of defining the process that we will use to develop.
I'm tasked with coming up with the SDLC and also the way to document it (i.e. paperwork, statement of work, contract) that we give to the deparment that is requesting development.
|
|
|
|
|
fuziononline wrote: I work in a application design department that designs in c#
Not sure how to respond to that. See if this helps:
Implementation (or coding) Reducing a design to code may be the most obvious part of the software engineering job, but it is not necessarily the largest portion.
link[^]
also SDLC[^]
|
|
|
|
|
There are a lot of different lifecycle models to choose from and each one has pros and cons.
Do you currently have any level of process in place that governs how software projects are run? It doesn't have to be something formally documented. If so, try to pick a model that resembles that process as close as possible and then refine the model from there.
The main thing is that no model is perfect and no model will completely fit your business without modification (to either the business, the model, or both).
In general, the documentation steps that should be followed are:
- Define the business requirements (high level, business-oriented requirements). This is what the software needs to do, problems it needs to solve, etc. in order for it to be competitive in the market.
- Define the technical requirements for each business requirement. The technical requirements define how the business requirement will be met by the software. Each business requirement can map to one or more technical requirement, but generally one technical requirement should map to one business requirement. This also should cover any integration points to other systems that might be needed.
- (Optional)Define a lower-level set of technical requirements that map to a single higher-level technical requirements. Again, one high-level technical requirement could have multiple lower-level technical requirements.
The developers would work from one of the technical requirement docs. The QA group would base their test plans on the buisness requirements, and the test plans should be written at the same time as the business requirements.
As for actual development cycles, there are many different models and you should choose the one that works the best for you. I have found that the best approach is using short cycles (3-4 weeks each). Each cycle has a clearly defined set of goals and requirements that need to be met. At the end of the cycle, everything is reviewed and things that didn't get completed become part of the next cycle. This allows the business stakeholders to see progress and everyone to evaluate that progress against the business needs early enough where changes and/or rework aren't as painful. (They will always be painful, but it's much easier to loose a few weeks worth of work than a few months.)
The bottom line is that you need to evaluate all of the different models and make the best choice you can. Then figure out what pieces of the model and/or business need to be modified or adapted to work for you. It may be a trial-and-error process until you get things right, but as long as you're not constantly changing tactics every few days (or even few weeks) it shouldn't be a problem.
The key to a process is that you want to build something that allows for consistent repeatability.
Another thing to consider is that SDLC processes should also include things like how QA testing is performed, how builds are performed (automated builds are the best), and how the software is released.
|
|
|
|
|
in my application i use sql server login and i want to verify whether the connection successfully built.to do this as one of you freinds said i tried connection.state, now i get the response but not the correct one,even wrong username/password it gives successfully logged.(means always dd.getconstate give open)
i created a DBconnection class
class DbConnection
{
private SqlConnection SQLCON;
private SqlCommand sqlcommand;
SqlDataReader sqldreader;
private ConnectionState gg = new ConnectionState() ;
public void openConnection(string usr, string pwd)
{
SQLCON = new SqlConnection();
sqlcommand = new SqlCommand();
SQLCON.ConnectionString = "user id =" + usr + "password="
+ pwd+ "encrypt=true;" + ";integrated security = true;" + "
initial catalog = my;" + " data source =buddhika\\SQLEXPRESS";
SQLCON.Open();
sqlcommand.Connection = SQLCON;
gg = SQLCON.State;
}
public ConnectionState getconstate
{
get { return this.gg ; }
}
}
when the logon button click
try
{
dd.openConnection(textBox1.Text, textBox2.Text);
dd.getCommand().CommandText = "insert into my.dbo.loggedin
values(getdate(),'" + service_no + "',getdate())";
if (dd.getconstate==ConnectionState.Open)
{
MessageBox.Show("login sucessfully");
dd.executeConn();
dd.closeReader();
}
else
{
MessageBox.Show("failed log");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
|
|
|
|
|
prasadbuddhika wrote: SQLCON.ConnectionString = "user id =" + usr + "password="
+ pwd+ "encrypt=true;" + ";integrated security = true;" + "
initial catalog = my;" + " data source =buddhika\\SQLEXPRESS";
So that's how it's done? Really.... that's how we build strings in 2007?
You ever heard of String.Format or StringBuilder?
prasadbuddhika wrote: i use sql server login
So you make an account in SQL Server for ever one of your users?
|
|
|
|
|
Hi,
i am working in windows application of C#
i am using hash table.
i want to add data to hash table from datatable named DTSchool. I have a school name in combobox. when iselect school in combo it takes the curresponding SchoolID from the datatable
i want to know how to write code for that. i wrote like this
List.Add(SchoolDT.Rows[cboSchool.SelectedIndex]["SchoolID"],cboSchool.Text.ToString());
.But it is not taking value from datatable.Please help me regarding this problem?
|
|
|
|
|
I doubt this is a syntax problem. If it was the compiler would be complaining. You have a run time error.
sajin85 wrote: cboSchool.Text.ToString()
Why are you calling ToString() on something that is already a string?
Are the rows in the DataTable order the same way as the items in the combo box?
|
|
|
|
|
Hi,
Are you sure the indexes of the items in your combobox matches the row indexes in your datatable?
Maybe posting a little bit more code might help to tackle your problem.
Mark
|
|
|
|
|
Hi
Anyone who knows how to add filetype programmatically in media player ?
For instance: The player accept .wav but i wish to set the player so it also accept .mp3, programmatically.
Any ideas ?
I tried msdn but dont find anything
With regards
Heino
|
|
|
|
|
Do you mean create a file association so that when you double click on an mp3 it opens with WMP11? If so, that requires some registry hacking - check here[^]; this article simplifies things a bit by providing a wrapper for the registry nastiness
|
|
|
|