Hello:
I tried to keep my code lined up, but some is off alignment. I know this is just a cosmetic thing.
Is there something in Visual Studio 2008 that can format my source code? If not, is there some free utility?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
theLizardPosted Feb 28, 2010, 5:13 PM
Yes there is and I love the code and the lessons you are receiving,
string querystring = "Driver={Microsoft Text Driver (*.txt; *.csv)};defaultdir=C:\\IceCorp;driverid=27;fil=text;filedsn=C:\\IceCorp\\IP_Login.csv;maxbuffersize=2048;maxscanrows=8;pagetimeout=5;safetransactions=0;threads=3;uid=admin;usercommitsync=Yes";
OdbcConnection con = new OdbcConnection(querystring);
con.Open();
for (int i = 0; i < dataGridView2.RowCount - 1; i++)
{
OdbcCommand cmd = new OdbcCommand("insert into IP_Login.csv values('" + dataGridView2.Rows[i].Cells[0].Value.ToString() + "','" + dataGridView2.Rows[i].Cells[1].Value.ToString () + "','" + dataGridView2.Rows[i].Cells[2].Value.ToString() + "')", con);
cmd.ExecuteNonQuery();
}
But I hope you are going to do a little more with the really simple code you got.
I see that in search of getting the really simple code you are spending a considerable amount of time going over the same things like
How do I: ReadLine and split columns?
Well, I told you that about 2-3 days ago using the following bit of code that filled a SINGLE data grid WITHOUT an ODBC Driver NOT needing a Connection String
while((l = sr.ReadLine()) != null)
{
Array.Resize(ref e, e.Length +1);
e[e.Length-1] = new lineElement();
Array.Resize(ref e[e.Length-1].elements, getCount(",", l));
e[e.Length-1].elements = l.Split(new char[] {','});
This line splits the columns. e[e.Length-1].elements = l.Split(new char[] {','});
But I guess this code was not simple enough and you wanted a better way to program, never mind, I am sure one day you will come to realise.
Georgio, Could you answer my curiosity, you indicated that you will be using MS Sql as your database, will you be using ODBC commands for all of you SQL work or will you be combining odbc and SqlData in you application!
In the beggining you stated that your application will have around 400 forms and I asked are you for real, remember that? You decided on a tree view solution to call these forms and it was only the other day that I asked myself this question, will the 400 forms be represented as a node of the tree or a entity which is associated with a form if 400 forms are to be represented in the tree, you will have truly designed a system nobody wants to use.
Can you imagine scrolling down a tree to find the form you want.
If the tree nodes are entities like clients, users, properties, accounting, distribution blah blah blah, how will the forms not dirtectly associated with an entity be called if one needs to be called?
Looking at some of you questions and replies I see that you are mixing VB examples and C# examples, not a good idea, if you arening a language it is best to seek and ask question and give examples of what you want to acheive in the language you are learning.
If you want to bloat your application with things that are not really needed then I guess that is a choice that you make at the expense of the KISS principle.
I guess this is what Sam meant by "It is too easy to start on that path and by the time you realize it is not the most efficient use of development time"
From the question I see you ask, you are a beginner and it is prudent to ask these questions but you need to also identify those who are REALLY trying to help from those who answer question, sometimes with little relevence, for the purpose of making a modest income from giving answers. If you are going to contribute, then maybe you should seek out a school that teachers the language you intend using and get proper tuition.
I love comming to this forum, sometimes I get LOL's and sometimes I shake my head and wonder why beginners are teaching beginners by resaerching the question you ask then posting links to other peoples works and ask for their response to your question be marked as the accepted answer when no aswer was given by the responder.
You appear to be on the road to becomming a reealy GOOD programmer, like some of the ones who are answering your questions :(
Amazing...