|
Hi Dear,
You have comma seperated string value and want to bind it with checkboxlist.
first of all you split the value with comma and store it into the Array or ArrayList and now you can easily bind the checkboxlist with this Arraylist.
Let me know if you got any problem.
Regards,
_Anil
Anil Chauhan
|
|
|
|
|
Anil,
Logically thats correct - but sadly - this is windows application hence I can not bind checkedlistbox. There is no Datasource and Databind members ..it s in webcontrol!
thanks anyway,
Jeet
|
|
|
|
|
There is a DataSource property.. It's inherited from ListControl, and there's even an example provided (although granted, it's MSDN quality). Have you set ValueMember and DisplayMember, and (I think) put your data into a structure?
|
|
|
|
|
I am a newbie and do not know how it can be worked out to solve my problem!
plz bear with me and suggest something
regards
Jeet
|
|
|
|
|
Hi friends,
it was as simple as it looks!
arrFieldList = new ArrayList(strAllFields.Split(new char[] { ',' }));
for (int i = 0; i < arrFieldList.Count; i++)
{
checkedlistbox1.Items.Add(arrFieldList[i].ToString());
}
regards
Jeet
|
|
|
|
|
I had a .Net application developed in visual studio 2005, I was able to make msi setup of it, if I want to install my setup on other system in which .Net framework is not there, I want .Net framework also to get installed simultaneously with my application through msi setup?
How can I add .Net framework in msi setup?
|
|
|
|
|
Hi. IN the Setup Project under Soltution Explorer under the detected dependencies you should notice that the Micorsoft .NET Framework is listed there. Next go the the PRoject button on the Menu. THis should bring up the Propery Pages. Click on the Preequisites button. There it will show you the prerequisites. Make surethat the .NET Framework 2.0 is clicked. Below that you will notice three options. Select the one that states "Download prerequisites from the same location as my application" and this will install the .NET framework from the same location as you MSI.
Hope this helps.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
I'm using SMTP classes and sending notifications from my application, When we run the application on test LAN (Local Setup)it works smoothly, so my SMTP settings are correct, But when we deploy our solution on hosting server (GoDaddy.com) none of the emails are going out. No exception, No Error !
Has anyone faced similar issues before.
Thanks
|
|
|
|
|
Dear brothers,
I have read the book and searched from the internet. They told me the same way in retrieving data from SQL server. Unfortunately, it errors something when I do the same way. See my codes below :
private void btn_login_Click(object sender, EventArgs e)
{
string sSQL = "SELECT USERNAME, USERPASSWORD FROM TBL_USER WHERE USERNAME = '" + this.txt_username.Text + "' AND USERPASSWORD = '" + this.txt_username.Text + "'";
SqlCommand sCommand = new SqlCommand(sSQL, dbConnection.sqlCnn);
try
{
dbConnection.sqlCnn.Open();
SqlDataAdapter sReader = sCommand.ExecuteReader();
// It says : "Cannot implicitly convert type'System.Data.SqlClient.SqlDataReader' to 'System.Data.SqlClient.SqlDataAdapter'"
while (sReader.Read() == true)
{
frm_main frmparents = new frm_main();
frmparents.ShowDialog();
}
}
catch (Exception Er)
{
MessageBox.Show(Er.Message, "Exception");
}
Thanks for reading the entire article.
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
misCafe wrote: AND USERPASSWORD = '" + this.txt_username.Text + "'";
BTW: normally one does not store the password, instead it gets hashed and it is the hash that gets stored and compared/searched.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Oh yes, I have changed the text box. But it still errors when I press F5.
Then how?
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
Hi,
I have no experience with SqlDataAdapter, however the compiler is correct (obviously) when it says the result of ExecuteReader() is an SqlDataReader and not an SqlDataAdapter.
I suggest you look at the relevant documentation and/or google for correct examples.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
misCafe wrote: SqlDataAdapter sReader = sCommand.ExecuteReader();
This is where the problem is. ExecuteReader method returns a DataReader object and NOT the DataAdapter object.
In case you need to use the DataAdapter , initialize it using the parameterized constructor and then use its Fill method. ObjectBrowser will help you finding about these.
जय हिंद
|
|
|
|
|
Many thanks for taking a part on this article
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
Also, please check Readup on SQL Injection.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Oh well, It was my mistake. I may blind! It must be SqlDataReader in fact!
Thanks again!
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
I'm wondering, how would I go about doing this in a much easier and logical manner? I have a lot of checkBox's being used and each one needs this exactly type of coding, just each one consecutively needs to have their object number +1 as shown below.
object cb1 = checkBox1.Tag;
object cb2 = checkBox2.Tag;
object cb3 = checkBox3.Tag;
if (checkBox2.Checked == true)
{
cb2 = "1";
}
else
{
cb2 = "0";
}
if (checkBox3.Checked == true)
{
cb3 = "1";
}
else
{
cb3 = "0";
}
if (checkBox1.Checked == true)
{
cb1 = "1";
}
else
{
cb1 = "0";
}
Help would be greatly appreciated!
|
|
|
|
|
Hi,
this does not make much sense to me. What is the use of storing the checked state in a string which is inside the Tag property, when the Checked state is already available as a boolean?
Anyway, this probably is what you asked for:
foreach(Control c in Controls) {
CheckBox cb=c as CheckBox;
if (cb!=null) cb.Tag=cb.Checked?"1":"0";
}
works whatever the number of checkboxes is, as long as they are all present in this.Controls
(if they are nested in panels, groupboxes, whatever, you may need some recursion).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I suspect you are trying to be able to have a property with a 1 or 0 rather than a true or false (i.e. you dont ACTUALLY want to use Tag with a string, you are just using that as it is convenient)
If that's the case, why not make your own Checkbox:
using System.Windows.Forms;
namespace SomeNamespaceOrOther
{
public class MyCheckBox : CheckBox
{
public int TrueFalseValue
{
get
{
return Checked ? 1 : 0;
}
}
}
}
Then use it like your normalk checkbox, but access the TrueFalseValue property rather than the Tag or Checked property.
You can give it a 'setter' if you want - so setting the property to, say, 0 will make the checkbox unchecked.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Can I use VStudio to design sleek looking windows applications, something like Google Chrome. If yes how?
|
|
|
|
|
Yeah you can, UI's can be tricky to design, but there is no reason why not if you put in enough effort.
humayunlalzad wrote: If yes how?
By coding.
|
|
|
|
|
You might want to use WPF if you want 'prettyness'
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
|
suppose I have 3 functions.
1.
[CustomAttrib("First")]
public int Foo1(ref int x, out float y, SomeDelegate callback)
2.
[CustomAttrib("Second")]
public Stream Foo2(string name, SomeEnum enums);
3.
[CustomAttrib("Third')]
public void Foo3(string message, out double count, SomeStruct str);
Now what I want to do, is to validate each function according to their attribute. I want to create only one function named Validate which will validate all the above functions and then call them.
I tried to use delegate, lambda expression in Validate to pass the function, but nothing can get the attribute data.
I already tried :
public object Validate(Func<object> method) { .... } and call it as
Validate(() => Foo1(ref x, out y, DoCallBack));
or
public object Validate(Delegate method) { .... } & call it as
Validate(delegate() {return Foo2(null, SomeEnum.EnumValue); };
but none of them can get the attribute information of the called function
[Foo1, Foo2 etc.] in the body of Validate function.
Can anybody please suggest me any way-around to accomplish this task?
modified on Friday, May 22, 2009 12:32 AM
|
|
|
|
|
Hello,
I have datagrid in my application.
I want to create event that will be raised when datagrid columns were reordered by user (and then do something).
how can i do it?
|
|
|
|