|
Hi Everybody,
Could you help me out from the following problems
related to List view (View: Details) ?
1) How to select the subitem?
2) How can I select one subitem and an item (if possible) ?
3) How to make both items & subitems editable?
Thanks in advance,
Sarvan AL
|
|
|
|
|
for selecting item in listview u can try
foreach(ListViewItem lstitm in listView1.Items)
{
if(lstitm.Index==0)
{
lstitm.Selected=true;
}
}
where lstitm.Index is the row number which u want to select
and for editing the subitem u can try
foreach(ListViewItem lstitm in listView1.Items)
{
if(lstitm.Index==0)
{
lstitm.SubItems[0].Text="xyz";
}
}
rahul
|
|
|
|
|
I need a C# sample project book,
for datadriven application and winsock programming
|
|
|
|
|
For Data driven applications you can refer 'Data-Centric .net programing with c#' wrox publication.
|
|
|
|
|
Using C#.net we have created a custom Textbox control derived from System Textbox class. We alse have a customized design surface,toolbox,propertygrid. The control is dragged and dropped on the design surface and its properties are displayed in propertygrid.
1. Custom textbox is not directly linked to propertygrid ( propertygrid.selectedobject=ObjTextbox is not used)
2. When we change Location/Size of the control using mouse we are unable to update the propertygrid
3. The object resizing does not happen physically.
4. When we drag the control to a different location on design surface, control comes back to its initial position.
Any help is appreciated.
Thanks in advance.
|
|
|
|
|
Hi,
Myself imran, I am quite new to dotnet. i am developing web application using asp.net and C#(Visual Studio 2005). i have defined connection string in web-config
Can any one help me to know How to Access database using this connetion string.
thanks
regards
imran khan
|
|
|
|
|
Welcome to The Code Project.
Please don't post the same question all over the place. Pick the forum that best fits your question.
---
b { font-weight: normal; }
|
|
|
|
|
OleDbConnection dbConnection;
dbConnection = new OleDbConnection();
dbConnection.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; " +
"Data Source = " + Application.StartupPath + "\\Data.mdb";
|
|
|
|
|
Hi ,
I want to windows application(C#/VB) example for MDI form and Child Form using menu strip (like as Visual Basic6.0).
Thanks in advance,
Rameshkumar
|
|
|
|
|
When i try to open windows/web application(...in c#)....
its throwing the error message states that....visual c# 2005 compiler could not be created....the system cant find the object specified..... i reinstalled the whole frame work still its giving me the same error...
It is working for VB applications.
can anyone of u help me ...asap
|
|
|
|
|
may be ur application is built in VS 2003 which first require conversion to VS 2005.
|
|
|
|
|
I tried to insert some value to a table, I received the following error
<br />
no value given for one or more required parameters<br />
Here is the code; the ID field is the primary key autoincremented, I don't know how to set it; I simply set it to 1
<br />
OleDbConnection dbConnection;<br />
<br />
dbConnection = new OleDbConnection();<br />
<br />
dbConnection.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; " +<br />
<br />
"Data Source = " + Application.StartupPath + "\\Data.mdb";<br />
<br />
<br />
<br />
string sqlstr = "INSERT INTO Datas(ID, FirstName, LastName , Function, Description, SDate, EDate, THour)" +<br />
<br />
"VALUES(1, John, Do, FunctionOne, DescriptionOne, 12-02-03, 12-02-06, 20)";
<br />
<br />
<br />
OleDbCommand cmd = new OleDbCommand(sqlstr, dbConnection);<br />
<br />
<br />
<br />
try<br />
<br />
{<br />
<br />
dbConnection.Open();
<br />
cmd.ExecuteNonQuery();<br />
<br />
dbConnection.Close();<br />
<br />
}<br />
<br />
catch (Exception ex)<br />
<br />
{<br />
<br />
MessageBox.Show(ex.Message, "Database Error");<br />
<br />
}<br />
<br />
|
|
|
|
|
if ID column is identity field
you are not suppose to include the column in insert list and values list
|
|
|
|
|
You have forgotten to put apostrophes around the string values.
---
b { font-weight: normal; }
|
|
|
|
|
What do you mean by putting string? I assume you mean something like that 'FunctionOne', etc. I will try that this evening.
|
|
|
|
|
There may be some other fields in the table which do not allow null values
or
John, Do, FunctionOne, DescriptionOne --- if these are variable then
may be values are null or empty string.
|
|
|
|
|
how to write the query to select 10 record from database
|
|
|
|
|
Depends where the 10 records are. SELECT TOP 10 will get the first ten records matching the criteria. If you want 10 records in teh middle or end then you have more work to do.
only two letters away from being an asset
|
|
|
|
|
Select top 10 * from <tblname>
|
|
|
|
|
ok how to get next 10 records from table ?how to write query to get it
|
|
|
|
|
You need to retrive 20 records and ignore top 10 to get next 10 records
|
|
|
|
|
or
Select top 10 * from agent where agentid not in (select top 10 agentid from agent)
|
|
|
|
|
How to change the Border style of Listbox in ASP .net
|
|
|
|
|
Type this in and once you press the . the intellisense should show you a list of border styles.
this.ListBox1.BorderStyle = BorderStyle.
www.DaytonaForums.com
|
|
|
|
|
I have tryed this one But it will change
|
|
|
|