|
hi all,
how will i know if a datagridview cell is left empty or not?
string.isnullorempty(dataGridView6.Rows[0].Cells[1].Value.ToString());
returns en error. [object reference not set to...]
any other method to check if empty or not ?
help please,
thanks in advance,
bye.
|
|
|
|
|
string s = dataGridView6[1,0].Value.ToString();
if (s != "")
{
.....
}
best regards
|
|
|
|
|
Hi,
I have a question about deployment project in C#. When we compile our project in c#. It generates two files one is perhaps setup and other is some thing called bootstrapper file. Now i want to know which of these two files is to be given to the user. I want the installer to install .Net and SQL Express if it is not installed on his machine already.
Thanks in advance...
Wasif Ehsan.
|
|
|
|
|
hi all,
i have a few things to ask about setup projects...
first, how can i add an uninstall option to User's Start Program.
second, how can i reinstall my setup even if a previous version was installed before ?
thanks in advance,
bye.
|
|
|
|
|
Firts one I'm not sure.
Second one, on the properties of your installer theres an option removePreviousVersions. Just set that to true
He who laughs last is a bit on the slow side
|
|
|
|
|
i want to write an application in c# that check either MSDE is installed on current machine to not if not then install MSDE on machine and copy SQL Server database (mdf and ldf) files to specific location so that my abouther c# application may use database could anybody help me out this please
|
|
|
|
|
I have the exact same problem. You can't use the installer within visual studio as it does not allow for multiple installation simultaniously.
So I started looking at external installers. Nice one to try is nullsoft installer, its freeware, you can be even include stuff like the runtime enviroment. You will just need to learn a bit about scripting so that you can manipulate the installer scripts as to what install when. They have alot of documentation and examples, so run through them, might even be able to mod one of the examples.
He who laughs last is a bit on the slow side
|
|
|
|
|
I made an c# application that uses SQL Server 2000 now i want to make a setup that not only installs my application but also MSDE to the clients machine so that my application can use database from MSDE how i would bmake that setup please help me out
|
|
|
|
|
Add the merge module of MSDE with your application. The merge module for module for MSDE is available with SQL Server in one of its subdirectory but exactly which one, i am not sure. But i think its extension is .msm . You can add that merge module to you application. So when your application installs, it will also be installed along with it.
Regards,
Wasif Ehsan.
|
|
|
|
|
Hi. I need help. When you assign the CustomActionData you do the following.
/textValueA=[EDITA1] /textValueB=[EDITA2]
The problem being that when the user enteres a two word value in EDITA1 it soesn't take the whole string as the value, it takes the first word as the value and uses the space between the firts and second word as the delim.
Is there some way that I can change the delim between
/textValueA=[EDITA1]?/textValueB=[EDITA2]
Thanks in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
I answered my own question.
/textValueA="[EDITA1]" /textValueB="[EDITA2]"
He who laughs last is a bit on the slow side
|
|
|
|
|
Glad you found out how to encapsulate these arguments.
You have to be careful, though, if you want to give a path as an argument.
Something like
/instPath="[TARGETDIR]" will give you a very strange error message (I think I remember something about the last " being escaped by the last backslash in the path or something similar).
You have to use
/instPath="[TARGETDIR]\" instead.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Thanks, will keep in mind, currently it's only getting the client details, Company name etc..
I know if you use the installer helper class, you can reference the installation path with
path = Context.Parameters["assemblypath"]
Problem is that it returns the whole installation path including the executable. eg
C:\Program Files\Test\Test1.exe
what I want is just the
C:\Program Files\Test\
Any Ideas???
Thanx
He who laughs last is a bit on the slow side
|
|
|
|
|
Well that's simple: Just use Path.GetDirectoryName() to get only the directory.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
i will tell in detail.if we write some no of collections(property) in dropdownlist it is displaying full length but i want the length should be reduced means i should get get scrolling.
|
|
|
|
|
I want to print many pages one times,but the print result was wrong!the print Height was small than my degsin heigth!
my report's properties set like these:
Report Property:
InteractiveWidth:21cm
InteractiveHeight:13.9cm
MarinTop .5cm
MarinLeft .2cm
MarinRight .2cm
MarinBottom .5cm
PageHeight:21cm
PageWidth:13.9cm
Body Property:
Height:21.1cm
Width:12.9cm
Table Property:
PageBreakAtStart:false
PageBreakAtEnd :True
I see some document write like this:"If the PageHeight is less than the PageWidth, then it is landscape, otherwise it is portrait.While you can programmatically change these via the SetProperties method on the web service, they will be overwritten if the report is republished. "
I change the Print Pages Format and size ,select portrait and set height 13.9cm ,set width 21.5cm,but the print Browse is not change,why?
The Print Result is wrong ,the Print Result width is right,but the
height is wrong ,is small than 13.9cm,only 7cm ,the Font was small too.
who can help me?tell me why?
|
|
|
|
|
Hi All ,
I am having the problem in setup deployment of windows application,ie:at present i am installing the s/w or setup file seperately ,framework and database saperately.but i want to make setup,which should contain framework setup,application setup and database.In a clear,when i install the setup( contains framework setup,application setup and database) in any machine it should automatically install the framework if it does not have the framework and it will install the application and create complete
database by simply clicking next...next buttons.
wheather i can do this,if possible plz give me the description and clear way of setup. I am also using the .dll of MS Enterprise Library for building the .config files and SQL 2005 express edition.
Thank You,
Mithun
|
|
|
|
|
Take a look at the NSIS project[^]. Its an easy-to-learn and in my opinion very useful open source system for creation of Windows installers. Among many others the web site provides a code example for Installing the Microsoft .NET Framework[^].
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I am working within a DataGrid and would like to select a whole row when the user clicks anywhere in the row. I am not sure how to accomplish this and would like some direction.
Best of luck,
Michael Baker
|
|
|
|
|
This code will help u to get the whole row of the grid selected when u click a check box in the corresponding rows of the grid. Hope this solves ur issue.
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace solCommon.Web.UI.DataGrid
{
///
/// CheckBoxColumn Derives from DataGrid Column
///
public class DGCheckBoxColumn : DataGridColumn
{
public DGCheckBoxColumn(): base()
{
}
public override void InitializeCell(TableCell cell,
int columnIndex, ListItemType itemType)
{
//let the base class initialize the cell
base.InitializeCell(cell, columnIndex, itemType);
if( itemType == ListItemType.EditItem ||
itemType == ListItemType.Item ||
itemType == ListItemType.AlternatingItem ||
itemType == ListItemType.SelectedItem ||
itemType == ListItemType.Header)
{
CheckBox checkbox = new CheckBox();
//assign an ID that we can use to find the control later
//we don't want to add a normal checkbox to the header.
checkbox.ID = (itemType==ListItemType.Header)? "checkboxHead": "checkboxCol";
cell.Controls.Add(checkbox);
}
}
public Int32[] SelectedIndexes
{
get
{
ArrayList selectedIndexList = new ArrayList();
//iterate each DataGridItem and find our checkbox
foreach( DataGridItem item in this.Owner.Items )
{
CheckBox chkBox =
(CheckBox) item.FindControl("checkboxCol");
//If it's selected then add it to our ArrayList
if ( chkBox != null && chkBox.Checked )
{
selectedIndexList.Add( item.ItemIndex );
}
}
return (Int32[])selectedIndexList.ToArray(typeof(
System.Int32 ) );
}
}
public object[] SelectedDataKeys
{
get
{
//Just iterate each of the selectedindexes and
//match it up to the datakey field
ArrayList dataKeyList = new ArrayList();
//make sure the datakeys have some values
if(this.Owner.DataKeys.Count > 0)
{
foreach( Int32 selectedIndex in SelectedIndexes )
{
object DataKey =
(this.Owner.DataKeys[selectedIndex].ToString());
dataKeyList.Add(DataKey);
}
}
return (object[])dataKeyList.ToArray(typeof( object ) );
}
}
public static void RegisterClientCheckEvents(Page pg, string formID)
{
string strCol = GetCheckColScript();
string strHead = GetCheckHeadScript();
if(!pg.IsClientScriptBlockRegistered("clientScriptCheckAll"))
pg.RegisterClientScriptBlock("clientScriptCheckAll", strHead.Replace("[frmID]",formID));
if(!pg.IsClientScriptBlockRegistered("clientScriptCheckChanged"))
pg.RegisterClientScriptBlock("clientScriptCheckChanged", strCol.Replace("[frmID]",formID));
RegisterAttributes(pg);
}
private static void RegisterAttributes(Control ctrl)
{
foreach (Control wc in ctrl.Controls)
{
try
{
if ( wc.HasControls() )
RegisterAttributes(wc);
CheckBox chk = (CheckBox)wc;
if (chk != null && chk.ID == "checkboxCol")
{
chk.Attributes.Add("onclick","CheckChanged()");
}
else if ( chk != null && chk.ID == "checkboxHead")
{
chk.Attributes.Add("onclick","CheckAll(this)");
}
}
catch
{
}
}
}
private static string GetCheckColScript()
{
string strScript;
strScript= " ";
strScript+=" function CheckAll( checkAllBox )";
strScript+=" {";
strScript+=" var frm = document.[frmID];";
strScript+=" var ChkState=checkAllBox.checked;";
strScript+=" for(i=0;i< frm.length;i++)";
strScript+=" {";
strScript+=" e=frm.elements[i];";
strScript+=" if(e.type=='checkbox' && e.name.indexOf('checkboxCol') != -1)";
strScript+=" e.checked= ChkState ;";
strScript+=" }";
strScript+=" }";
strScript+=" ";
return strScript;
}
private static string GetCheckHeadScript()
{
string strScript="";
strScript= "";
strScript+="function CheckChanged()";
strScript+="{";
strScript+=" var frm = document.[frmID];";
strScript+=" var boolAllChecked;";
strScript+=" boolAllChecked=true;";
strScript+=" for(i=0;i< frm.length;i++)";
strScript+=" {";
strScript+=" e=frm.elements[i];";
strScript+=" if ( e.type=='checkbox' && e.name.indexOf('checkboxCol') != -1 )";
strScript+=" if(e.checked== false)";
strScript+=" {";
strScript+=" boolAllChecked=false;";
strScript+=" break;";
strScript+=" }";
strScript+=" }";
strScript+=" for(i=0;i< frm.length;i++)";
strScript+=" {";
strScript+=" e=frm.elements[i];";
strScript+=" if ( e.type=='checkbox' && e.name.indexOf('checkboxHead') != -1 )";
strScript+=" {";
strScript+=" if( boolAllChecked==false)";
strScript+=" e.checked= false ;";
strScript+=" else";
strScript+=" e.checked= true;";
strScript+=" break;";
strScript+=" }";
strScript+=" }";
strScript+=" }";
strScript+=" ";
return strScript;
}
}
}
Vipin
|
|
|
|
|
I have a main form that is set to auto scroll so that when lower screen resoloutions are used, scroll bars are provided. The controls are not getting set back to position 0,0 but are displaying where ever the last scroll bar displayed the previouse control. Any way to get the controls to reset to display back at 0,0 and the bottom scroll bar to reset back to the left and the right one back to the top?
|
|
|
|
|
Hi guys what is wrong with this line? lookupObject is a struct. I just want to initialize the dictionary with the struct as value.
public static Dictionary<string, lookupojbect=""> dicTextLookup = new Dictionary<string, lookupojbect="">();
this is the error: "Error 1 Inconsistent accessibility: field type 'System.Collections.Generic.Dictionary<string,lookupojbect>' is less accessible than field 'dicTextLookup' C:\IL\TranslationController.cs 44"
Thanks
|
|
|
|
|
Could you repost that snippet, but check the "Ignore HTML tags in this message" checkbox when posting? We can't see your full code otherwise.
Is dicTextLookup non-public? Are you exposing the field as public? This error typically occurs if you're trying to expose some private/protected/internal thing as public. For instance
private class MyFoo {}
public class MyBar()
{
public MyFoo instance;
}
|
|
|
|
|
Sorry I didnt know about checking the checkbox, you solved my problem without looking at my code. Great!
|
|
|
|
|
How can I verify that the input in a textbox is numeric?
Jude
|
|
|
|