|
|
What the hell ? What does the singleton pattern have to do with persisting settings ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hey, I think i dint got your question properly, can u let me know that, the form which you are closing is Main form of the Application or child form.
If it is main form then you need to capture the "form load" and "form closing" event of the form, and write your own code to save the settings on closing, and load the settings when the form is loaded.
|
|
|
|
|
I have some data on Collections model such as projectid, projectType and projectname. I stored this data as collections as below:
Collections<User>Projects = new Collections<User>;
foreach (DataRow dr in ds.Tables[0].Rows)
{
User u = new User();
u.ProjectId = Convert.ToInt32(dr["ProjectId"]);
u.ProjectType = Convert.ToString(dr["ProjectType"]);
u.ProjectName = Convert.ToString(dr["ProjectName"]);
Projects.Add(u);
}
This is working fine and I am able to insert data in this. Now I want to bind this collections to a RadioButtonList. means I need to show only the ProjectName for the RadioButtonList. So how will I bind this Collections<user> to a RadioButtonList? Can anybody please help me on this? Thanks in advance.
Thanks,
meeram395
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Which part are you stuck on ? Was the documentation you found with google, unclear ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I get it worked. Thanks.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi,
I needed to find the path of the MSI file through which i am installing the s/w.I needed to check certain file's path during installation(when Installer class is called ...
How can i get the path of the msi file from where the Installation initiated?.
Please Help...
|
|
|
|
|
Get it from where ? Within the MSI ? You can;t write MSIs in C#, can you ?
What I tend to do, is write my install path in the registry, so that other apps can find it later if need be, such as patches.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I think U didn't get me..
I just wanted to know a whether flie (like name 'abc')is in the same folder/path from where my installation package executed. I am using custom installation during which at a time i needed to look for this file if exist ignore else create..
I wanted to add this check when i call Install method..
|
|
|
|
|
What install method ? You say you're calling an install method, but you're talking about MSIs in a C# forum. So, are you using C# to write an MSI ? Are you calling some other sort of method, called install, that runs an MSI ? Are you talking about a C# program, or a process within the MSI ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
This is the code which i am talking about.. the position i mentioned in the code there i need to find the path for that specified file before calling that Configuration form .. i have to create MSI for my project..
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.IO;
using System.Reflection;
namespace Trade.CustomInstallation
{
[RunInstaller(true)]
public partial class CustomInstallation : Installer
{
public CustomInstallation()
{
InitializeComponent();
}
public override void Install(System.Collections.IDictionary stateSaver)
{
"Here I need to Check for the File "
ConfigurationForm frmConfig = new ConfigurationForm();
frmConfig.ShowDialog();
base.Install(stateSaver);
}
protected override void OnAfterUninstall(System.Collections.IDictionary savedState)
{
base.OnAfterUninstall(savedState);
//This method is used to delete all the files after uninstallation.
string rootPath = string.Empty;
string clientPath = string.Empty;
DirectoryInfo directoryInfo = Directory.GetParent(Assembly.GetExecutingAssembly().Location);
string currentDirectory = directoryInfo.ToString();
char[] separator = { '\\' };
string[] pathArray = currentDirectory.Split(separator);
//condition for Single drive like c:\
if (pathArray.Length == 2 && string.IsNullOrEmpty(pathArray[1]))
{
rootPath = currentDirectory + "Root";
clientPath = currentDirectory + "Client";
}
else
{
rootPath = currentDirectory + @"\Root";
clientPath = currentDirectory + @"\Client";
}
string[] subDirectories = Directory.GetDirectories(currentDirectory);
for (int subDirectoryCount = 0; subDirectoryCount < subDirectories.Length; subDirectoryCount++)
{
//Delete Root Folder
if (rootPath.Equals(subDirectories[subDirectoryCount]))
Directory.Delete(rootPath, true);
//Delete Client Folder
if (clientPath.Equals(subDirectories[subDirectoryCount]))
Directory.Delete(clientPath, true);
}
}
}
}
|
|
|
|
|
I didn't know you could write an msi in C#. So, all you need is System.IO.File.Exists to see if a file exists already ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,Friends i developed one application in C# win appl.
I used Globalization that i want to display all my lables,txtbox values,tabs in kannada.
but it working to labels that i am reading from resx.file.
But i am not getting to tabs,also store my txtbox values in access.
I am using Kannada Direct,MS access, problem is values in txtbox showing boxes.but it
storing kannada values in access.while retreving also it showing boxes.
please Help to come out.
|
|
|
|
|
I can vaguely understand this, but not well enough to know what you're asking....
What is Kannada Direct ?
Yathish hatter wrote: problem is values in txtbox showing boxe
Oh, OK. I think the problem is that the textbox is not using a font that includes the characters that are stored. So, you need to set the font of the textbox to one that can display those values.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Dear All,
I am want to change color of text or string through code in c #, I have a rich text box in which i fill data by for loop and i find that word which i want to change like word is Software and now i want to change its color like red and display in same rich text box code which i am using,
string[] strval;
strval = dr["bReceivedData"].ToString().Split(' ');
for (int i = 0; i < strval.Length; i++)
{
if (strval[i] == "Software")
{
abc = abc + strval[i];
txtcolor.Text = strval[i];
}
else
{
abc = abc + strval[i];
}
I get name successful now tell me please how can i change color of word and which technique is better for this, I thing dot net provides brush or some thing like that.
Kindly do replay.
Thanks
|
|
|
|
|
richTextBox.SelectionColor = Color.Red;
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
|
|
|
|
|
hi here is my code in this i give the file name and sheet name and display the sheet in gride but my client want to open any excel file dynamically. Need a help,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Core ;
using System.Data.OleDb;
using Excel;
using System.Reflection;
using Microsoft.Office.Tools.Excel;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
Excel.Workbook wb;
Excel.Worksheet ws;
public Form1()
{
InitializeComponent();
//wb = new Excel.Workbook();
// ws = new Excel.Worksheet();
}
private void button1_Click(object sender, EventArgs e)
{
string filename = @"C:\mangesh1\mor\abc.xls";
String connectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
//String connectionString="Provider=Microsoft.Jet.OLEDB.4.0;"+"Data Source="+filename +";"+"Extended Properties=Excel 8.0;";
OleDbCommand selectCommand = new OleDbCommand ("SELECT * FROM [sheet1$]", connection);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
dataAdapter.SelectCommand = selectCommand;
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
System.Data.DataTable dataTable = dataSet.Tables[0];
dataGridView1.DataSource = dataSet.Tables[0];
MessageBox.Show(dataGridView1.RowCount.ToString());
connection.Close();
/* openFileDialog1.ShowDialog();
openFileDialog1.ShowDialog();*/
// return sum;
// directorySearcher1.FindAll();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
//openFileDialog1.ShowDialog();
}
}
}
|
|
|
|
|
I want to download a file from server, I can do it with c# and webcliet method by connecting http
But What are the basic flow if I use HTTPS
Can you please give basics on how to connect and download files
If i use same code as HTTP connection, I am getting error like
Could not establish trust relationship for the SSL/TLS secure channel
Thanks in advance
PRabhakar
|
|
|
|
|
Hi
I am displaying a collection of objects in a datagridview by setting the datagridview's datasource to the collection property.
It works well, but now i want to display one of the properties as a combobox and not as a text field. I have found examples where one manually adds a new column and then setting it as a combobox, but nothing where the columns are automatically set from the properties of the object. Hope i make sense.
|
|
|
|
|
you have to manually add the ComboBox column.
try this
DataGridViewComboBoxColumn DGVcombo = new DataGridViewComboBoxColumn();
DGVcombo.HeaderText = "Combo Column";
DGVcombo.Name = "AnyName";
dataGridView.Columns.Add(DGVcombo);
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
|
|
|
|
|
Hi Guru,
I'm a newbie in C#, as i know i can get the MSIHANDLE by call MsiOpenDatabase from Win32 SDK, can i call this function directly or there is a better way to get MSIHANDLE.
|
|
|
|
|
Your best bet is to p/invoke the Win32 call.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
As has already been said, you could use PInvoke. However, I think you could also add a COM reference to Microsoft Windows Installer Object Library and work from there (msi.dll or something like that)
|
|
|
|
|
I have a little app that will resize its main form when data is loaded. Sometimes I need to move the form so it remains entirely visible on the screen.
If the mouse cursor happens to be over a particular control when that happens I would like to move the mouse cursor so its position relative to the top left of that control remains constant. I can only seem to get the mouse location relative to the top left of the screen and I can only seem to get the control position relative to the top left of its parent.
Back in my MFC days there were two methods ClientToScreen and ScreenToClient that would convert between positions relative to the top left of screen and top left of the controls client area. Is there an equivalent in dot net?
|
|
|
|
|
Your control and window classes have a PointToScreen and PointToClient method.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|