|
Should the comment be done with -- ?
And when I pass more than one statement in one Command I separate them with semi-colons (; ).
|
|
|
|
|
Hi,
I'm trying to determine if the row has been modified. I have used Visual Studio 2010 and dragged the controls onto the form, so VS has built everything. When a direction button on the navigator is clicked, I run this code.
x = Convert.ToInt32(reunionBindingNavigator.PositionItem.Text);
DataRow dr = KTReunionDataSet.Reunion.Rows[x];
Debug.WriteLine(dr.RowState.ToString());
if (dr.RowState == DataRowState.Modified)
return;
I start with row one, change the date on the calendar, click next, row 2 is now showing, don't modify anything on row 2, click the back button so we are now on Row 1, yet dr.RowState shows as UnModified.
Did I do something wrong or am I missing something?
Thank you,
Glenn
|
|
|
|
|
Hi Glenn,
I have used this code. It will work correctly.
int x = Convert.ToInt32(bindingNavigator1.PositionItem.Text);
DataRow dr = dt.Rows[x-1];
if (dr.RowState == DataRowState.Modified)
{
MessageBox.Show("Modified");
}
I don't know what you have done in second line. Which component(KTReunionDataSet)you are using?.
Thanks,
Gopal.S
Gopal.S
|
|
|
|
|
OKay, so I am writing a server program that connects many clients and sends them out data. The problem is that when a client disconnects, when trying to read from another client I get the error.."Unable to read data from the transport connection: An established connection was aborted by the software in your host machine."
I have the connections saved in a Dictionary
private Dictionary<TcpClient, string> Connections = new Dictionary<TcpClient, string>();
Connections.Add(tcpClient, currUser);
Connections.Remove(tcpUser);
string message = srReceiver.ReadLine();
tcpServer = new TcpClient();
tcpServer.Connect(IPAddress.Parse(ipaddress), port);
swSender = new StreamWriter(tcpServer.GetStream());
swSender.WriteLine("Whatever");
swSender.Flush();
swSender.WriteLine("Close");
swSender.Flush();
swSender.Close();
tcpServer.Close();
|
|
|
|
|
I wanted to add that the dictionary looks fine after the user has been removed.
And this works fine as long as everyone stays connected
|
|
|
|
|
hi all,
i have 3 devlopers work on a web application using visual studio 2005, i want to add this web application to vss (visual source safe), to decrease the problem between them developers.
can help me about how to add this web application to vss??
thanx all.
|
|
|
|
|
This is not really a C# question.
I think you should be consulting the VSS docuementation before proceeding further.
Here is something that can act as a guide to start using VSS.
|
|
|
|
|
hi,
i worked on vss for windows application and its succeeded, but i can not use it for web, i didn't know why its not work successfuly for web.
can u help me?
thank u
|
|
|
|
|
You have already asked this same question, and received many responses.
Continuing to ask the same question will just get you ignored.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes, we've recognized you. From the new wording of your question, I deduce that your 3 developers are working concurrently on a live copy of your website (or maybe even THE live website). (that's why all the stuff we told you yesterday didn't work .
This is the stupidest thing I've ever seen. Vss can't help you in this case. The codeproject can't help you. Your personal god may find it a challenge.
|
|
|
|
|
If you have Visual Source Safe installed, go into File > Source Control and then add the projects to Source Safe there.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi
i'm working with dataSetDesigner in my app,lately when i create a new tableAdapter, it's select command is null at runTime, but it configure correctly in dataSetDesigner. where is my problem and how to solve it ?
thanks
|
|
|
|
|
Without seeing the code you use to create the new tableAdapter, it is probably impossible to tell.
Post a code fragment - just the relevant bits - and use the "code block" widget to preserve any formatting. Then perhaps we can help...
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.
|
|
|
|
|
Post what you have done here (some code) and maybe somebody can help you..
|
|
|
|
|
Hi
it's simply creating new tableAdapter object from my tableAdapter class like this :
InstitutionDataSetTableAdapters.BookSalesHeaderTableAdapter adapter = new Institution.InstitutionDataSetTableAdapters.BookSalesHeaderTableAdapter();
|
|
|
|
|
I'm having a problem where an Unmanaged C++ project with a _cdecl calling convention is calling a c# function via COM.
The unmatched calling conventions are raising the following error:
The value of ESP was not properly saved across a function call. This is
usually a result of calling a function declared with one calling
convention with a function pointer declared with a different calling
convention
(In C#) I know that the calling convention can be set on a delegate, but how would I call the delegate through the interface of my c# project? Is delegate usage the wrong approach on the C# side? The unmanaged C++ side cannot be changed, the code must remain unmanaged and with the _cdecl calling convention.
|
|
|
|
|
When managed calls unmanaged, you can choose the calling convention, and specify it at both ends.
When unmanaged calls managed, it is _stdcall, and there is no way to deviate.
See the "two-side logging" example in my article here[^].
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 everybody,
I am trying to create a multicolumn listview knowing that it is not possible to do with a listbox
I have 2 questions:
the first is how can i display the header of the columns?
the second is how can i get data from a data base .sdf and display it on the colomuns of my listview?
Thank you in advance
|
|
|
|
|
bacem smari wrote: the first is how can i display the header of the columns?
just set the ListView's View to details.
bacem smari wrote: the second is how can i get data from a data base .sdf and display it on the colomuns of my listview?
Well, you could use dataBindings (see here: Data binding a ListView[^] not sure if it will help, but it looks like it might) or you can just populate the Items yourself.
|
|
|
|
|
hi,
thank you but i am trying to fill the listview with the result of a querry.
Can you help me?
|
|
|
|
|
Hi ,
This is the code that i am using.
It indicates no errors but my listview isn't filled with the result of the querry.
Can you help me.
private void button1_Click(object sender, EventArgs e)
{
string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(wCS);
SqlCeCommand command = sqlceconn.CreateCommand();
command.CommandText = "SELECT [ID],[Magasin],[qtyonhand] from stocks where ID like @txt";
SqlCeDataAdapter adapter = new SqlCeDataAdapter(command);
SqlCeParameter txt = new SqlCeParameter("@txt", SqlDbType.NVarChar);
txt.Value = textBox1.Text;
command.Parameters.Add(txt);
DataSet ds = new DataSet();
adapter.Fill(ds);
string[] str = new string[ds.Tables[0].Columns.Count];
foreach (DataRow dr in ds.Tables[0].Rows)
{
for (int col = 0; col <= ds.Tables[0].Columns.Count-1; col++)
{
str[col] = dr[col].ToString();
}
ListViewItem ii;
ii = new ListViewItem(str);
this.listView1.Items.Add(ii);
}
}
|
|
|
|
|
Well, first, glad to see that you figured out how to write the SELECT statement properly...or at least more so.
But the problem is still with the SELECT...or at least that's one problem. You said, WHERE ID Like @txt . That will only return values where ID is equal to @txt.
You need to add back in the '%'. Try:
txt.Value = "%" + textBox1.Text + "%";
If that doesn't work, then you would need to check the db. Also, you do realize that you're selecting exactly 3 columns, right? You don't need to ask the table how many columns there are because there will always be three.
|
|
|
|
|
thank you for the information.
I think that you didn't understand my code very well.
it's the datatable that i am getting the columns form.
every column must appear on the listview.
Can you help me?
thank you.
|
|
|
|
|
All that I was saying was that your SELECT statement only specified 3 columns,
SELECT [ID],[Magasin],[qtyonhand] from stocks where ID like @txt
If there are more columns and you want them all, then, it should just be
SELECT * FROM ...
|
|
|
|
|
thank you.
I know the command.
I just want these 3 columns.
|
|
|
|