|
I don't see why you'd want all three values in one string. A string array or a List would be a straightforward technique. Or you may want to define a class or structure to hold the values. It depends on what you plan to do with the values afterward.
|
|
|
|
|
I have a datagridview in which two clolumns are of combobox type.In one column i have country names in it.In second column i want the states names country to the country selected.
In this the problem is that when country name is changed in row n+1,the nth row value is also changing.
Please anyone can solve me this issue.
|
|
|
|
|
Its not possible unless you code in that way or I may not got your question.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
How are you binding the comboboxes? Can you post the code?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
private System.Windows.Forms.DataGridView jobSheetDGV;
private SABDBDataSet6 sABDBCountryDataSet;
private System.Windows.Forms.BindingSource countrytDetailsBindingSource;
private SAB.SABDBDataSet6TableAdapters.CountryDetailsTableAdapter countryDetailsTableAdapter;
private void jobSheetDGV_CellLeave(object sender, DataGridViewCellEventArgs e)
{
int rowIndex = jobSheetDGV.CurrentCell.RowIndex;
if (e.ColumnIndex == 3)
{
if (jobSheetDGV.Rows[rowIndex ].Cells[3].Value == null)
{
string sql2 = "GetCountryIdByCountryName";
DbCommand cmd2 = _db.GetStoredProcCommand(sql2);
_db.AddInParameter(cmd2, "CountryName", DbType.String, jobSheetDGV.Rows[rowIndex].Cells[2].Value);
using (IDataReader dataReader1 = _db.ExecuteReader(cmd2))
{
while (dataReader1.Read())
{
string sql = "GetStatesByCountryId";
DbCommand cmd = _db.GetStoredProcCommand(sql);
_db.AddInParameter(cmd, "CountryId", DbType.Int32, countryId.CountryId);
using (IDataReader dataReader = _db.ExecuteReader(cmd))
{
while (dataReader.Read())
{
states = new States(dataReader.GetInt32(0), dataReader.GetString(1), dataReader.GetString(2), dataReader.GetString(3),
dataReader.GetString(4), dataReader.GetInt32(5));
if (states != null)
States.Items.Add(states);
}
}
}
}
In this States is the column name.
The question is simple that i want to fill states in respective to the country selected.I have a country table with country id as primary key and a state table with country id as foreign key..
}
}
}
|
|
|
|
|
Hi ,
I am Srikrishna Murthy.
I want to implement MVC architecture in a windows application.My application should have Model-View-Controller.While designing the application I am not very clear about how to make calls from the controller to the downlayers.How we can achieve this one.I hope we will have some interfaces and we have to implement them.But,I am not exactly sure how to do this.
My scenario:
Say for example,
1)I have a windows form with two text boxes and 4 buttons for ADD,SUB,MUL,DIV
2)so,when user clicks on any button,from here the data goes to controller.
3)From the controller,How to pass the data to the downlayers.
Please help me .Thanks Inadvance.
Thanks,
M.Srikrishna Murthy
|
|
|
|
|
Why do you want to use MVC ? What problems do you expect it to solve ? I've done winforms apps that used MVC, mostly because I used custom controllers ,and I expected that being able to plug different controller classes into my architecture would meet a specific need, which it did. I've never used it since, as there's never been a situation where it made sense to do so. In that case, I simply used delegates to pass messages between my controller and my model, and between my model and my view.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi christian Graus,
Actually I want to make a desktop application in MVC architecture.
And in that application,Keeping the controller and Model constant ,I want to change the View .i.e
I want to able to communicate with the controller from a Windows Form,A Console Application and also a Web Page.And I want to know exactly how this layering can be done.
Please help me.Thanks Inadvance.
M.Srikrishna Murthy
|
|
|
|
|
Well, the other key component is that I used interfaces, so that I could use any class as the view, for example, so long as it implimented my interface, which then meant that the controller used the class by casting it to an instance of that interface.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi friends
I am new to this C# developement, right now i am working with VB.
Can you give me some links to switch over from VB to C#
Thanks in advance
|
|
|
|
|
The best link would be to buy a book of C# and start reading it.
I am sure it won't take much time as you are familiar with VB.
|
|
|
|
|
I don't know of any off hand, but because most code you write, uses the .NET framework, which is the same, the main things are to get used to using braces and using square brackets for arrays, and semi colons at the end of lines. Apart from the grammar, the languages are basically the same.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
HI,
Im gettin an exception saying "InvalidOperationException" nd it says "No data exists for the row/coloumn", for the following code, nd d exception results on the d line that has been underlined....please check d code nd help....plssss!!!!
int rnd;
int totalcount = 0;
Random SelectRandom = new Random();
OleDbConnection access = new OleDbConnection();
OleDbCommand accesscmd = new OleDbCommand();
OleDbDataReader reader;
if (combo_Category.Text == "Book")
{
string connectionstring = "Provider = Microsoft.Jet.OLEDB.4.0;
Data Source = |DataDirectory|\\HangmanDatabase.mdb";
access.ConnectionString = connectionstring;
access.Open();
accesscmd.CommandText = "Select * From Book";
accesscmd.Connection = access;
reader = accesscmd.ExecuteReader();
while (reader.Read())
{
totalcount = totalcount + 1;
}
if (reader.HasRows)
{
rnd = SelectRandom.Next(0,totalcount - 1);
book = reader[rnd].ToString();
datastring = book.ToCharArray();
}
access.Close();
convert();
}
Pleassssssss help!!!
Ξ:::...£!ΠŤØ...:::Ξ®
|
|
|
|
|
linto_11 wrote: nd d
linto_11 wrote: d code nd help
This txt speak makes you look even more retarded than posting a new question right above your old one does.
linto_11 wrote: book = reader[rnd].ToString();
You need to read some books, and read the documentation. You can't just invent code and expect it to work. What your code does, is reads every row. Then, the reader is pointing to the end of the file. Then your code, in theory, tries to read a column of data on the current row, only, it's no longer pointing to a row. The issue is that you have no idea what you're doing.
The way I would do this, is to read the data into a dataset, then check how many rows the table has, and access a random row from there. That would have the distinct advantage of actually working. The other way would be to store the data into an array as you read it, then access the array at random. That would have the advantage of being something you could do on load, and remove words as you use them, meaning you don't need to access the DB again for that game session.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
linto_11 wrote: book = reader[rnd].ToString();
Are u sure with this?
CG is rite, first read some book.
|
|
|
|
|
im not workin.......im a student....searchin for doubts!!
Ξ:::...£!ΠŤØ...:::Ξ®
|
|
|
|
|
If you want to be a student, start by buying books, not by guessing what code you think will work. Then you will be fine. Buy a book.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Then its really advisable for you to read a book first.
I still didn't understand the logic of posting same question.
|
|
|
|
|
Tks a lot for ur advice....i'll look that i buy a book nd study first..tks!!
Ξ:::...£!ΠŤØ...:::Ξ®
|
|
|
|
|
Can u help me with which books to study????.....i wld b very much thankful!!
Ξ:::...£!ΠŤØ...:::Ξ®
|
|
|
|
|
Buy any book for Beginners in C#.Net.
|
|
|
|
|
linto_11 wrote: Can u help me with which books to study
Well, since you posted this question in the C# forum, I think the first one you need is on C#. If you want to start immediately then .NET Book Zero[^] will get you going.
|
|
|
|
|
At this point, I can't imagine there is a book that WOULDN'T help. Just learning to use google and read the MSDN would be a huge help. Just buy a cheap book on C#, that is for beginners. The 24 hour or the dummies books are a good place to start.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Don't forget one on how to write clearly, without using txtspk!
|
|
|
|
|
I love it when I'm the one who gives the answer, and they won't respond to anything I say.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|