|
provide your database info
//set the database loggon information.
//**Note that the third parameter is the DSN name
// and not the Database or System name
reportDocument.SetDatabaseLogon("pchitriv", "Windows2000",
"TestDB_DSN", "testDB", false);
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
Score it if you like my post
|
|
|
|
|
Hello,
I think I am posting this question again but I'm quite frustrated as I haven't found any way around.
I have a databound datagrid in which New/Blank rows are added to this datagrid on a button click event. This button is outside the datagrid and not in the footer. The datagrid populates well and I can do the edit/update to the already created records. I recently had to add a new checkbox field to my data table. This chekcbox field is to be included in this datagrid. The chkbox works fine for previously created records but as soon as I hit the 'Add New Row' button I get the following error :
Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid.
Source Error:
asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# DataBinder.Eval(Container.DataItem,"currentdriver") %>' />
My code for adding a new/blank row (on button click event) is as below:
RefreshGrid()
Dim ds as DataSet = DataGrid.datasource
Dim blank as DataRow = ds.tables(0).NewRow()
ds.tables(0).Rows.insertAt(blank, ds.tables(0).Rows.Count)
DataGrid.EditItemIndex = ds.tables(0).Rows.Count-1
DataGrid.DataBind()
and my checkbox template column is as below:
asp:templatecolumn headertext="Current Driver?">
itemTemplate>
asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# DataBinder.Eval(Container.DataItem,"currentdriver") %>' />
I really am clueless on this one. everything seems fine. Nulls are allowed on this field in my datatable.Please help!
Thanks.
-- modified at 23:58 Monday 26th February, 2007
Aartee.
...HE is watching Us All!
|
|
|
|
|
Try to change your itemplate column to this.
C#
<itemTemplate>
<asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# DataBinder.Eval(Container.DataItem,"currentdriver")== System.DBNull ? false : DataBinder.Eval(Container.DataItem,"currentdriver") %>' />
</itemTemplate>
VB
<itemTemplate>
<asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# Iif(DataBinder.Eval(Container.DataItem,"currentdriver")== System.DBNull, false, DataBinder.Eval(Container.DataItem,"currentdriver")) %>' />
</itemTemplate>
Regards,
Mark
|
|
|
|
|
Hello Mark,
A big thankyou for your prompt help and your time to read my post.
I jumped to the solution and did a copy-paste (VB code), but I get the following error :
Compiler Error Message: BC30201: Expression expected.
Source Error:
asp:templatecolumn headertext="Current Driver?">
itemtemplate>
asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" checked='<%# Iif(DataBinder.Eval(Container.DataItem,"currentdriver")== System.DBNull, false, DataBinder.Eval(Container.DataItem,"currentdriver")) %>'
enabled="false" />
/itemtemplate>
what am I doing wrong?
Aartee.
...HE is watching Us All!
|
|
|
|
|
try to replace the logical codition "==" to "=".
VB - Old Code
<itemTemplate>
<asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# Iif(DataBinder.Eval(Container.DataItem,"currentdriver")==System.DBNull, false, DataBinder.Eval(Container.DataItem,"currentdriver")) %>' />
</itemTemplate>
VB - New Code
<itemTemplate>
<asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# Iif(DataBinder.Eval(Container.DataItem,"currentdriver")=System.DBNull, false, DataBinder.Eval(Container.DataItem,"currentdriver")) %>' />
</itemTemplate>
Regards,
Mark
-- modified at 1:38 Tuesday 27th February, 2007
|
|
|
|
|
Hi Mark,
Thanks once again for your help. I tried to change the code as per your suggestion above but now I am getting error : BC30691: 'DBNull' is a type in 'System' and cannot be used as an expression.
any ideas?
Thanks.
Aartee.
...HE is watching Us All!
|
|
|
|
|
Thanks MArk, it has worked finally, you were thinking right, just that I had to use 'Is System.DBNull.Value' in place of '==' or '='.
Thanks a ton for your solution, it worked like magic.
Aartee.
...HE is watching Us All!
|
|
|
|
|
hi
Am using the Tabstrip and Multipage control given in
http://msdn.microsoft.com/library/default.asp?url=/workshop/webcontrols/overview/multipage.asp[^]
Its working fine.But i need to adjust the height of each tabpage according to the content of that tab.
One tab contains only 4 controls where as the other contains 10 controls.
I want to set their height according to its content.
In each tab,all the controls are placed inside a HtmlTable.I tried to adjust the table's height.but it didnt work.
snippet is
<br />
<TABLE id="TabStripTable" cellSpacing="3" cellPadding="0" width="100%" border="0"><br />
<tr><br />
<td bgColor="#e8e8e8"><br />
<mytab:tabstrip id="myTabStrip1" runat="server" SepDefaultStyle="background-color:#FFFFFF;border-color:#AAAAAA;border-width:1px;border-style:solid;border-top:none;border-left:none;border-right:none;" TargetID="MULTIPage1" TabDefaultStyle="color:#333333;background-color:#e8e8e8;border-color:#AAAAAA;border-width:1px;border-style:Solid;font-family:Verdana;font-size:11px;height:21;text-align:center;" width="70%" TabSelectedStyle="color:#993333;background-color:#FFFFFF;border-bottom:none;" BorderStyle="None"> <br />
<mymultipage:Tab Text="Info1" ID="tab0" ToolTip="Info1"></mymultipage:Tab> <br />
<mymultipage:TabSeparator></mymultipage:TabSeparator> <br />
<mymultipage:Tab Text="Info2" ID="tab1" ToolTip="Info2"></mymultipage:Tab> <br />
</mytab:tabstrip><br />
</td><br />
</tr><br />
</TABLE><br />
<br />
<mymultipage:multipage id="MULTIPage1" runat="server" width="780" height="300px"><br />
<mymultipage:pageview id="Info1"><br />
<TABLE id="ThirdMainTable" cellSpacing="10" cellPadding="0" width="780" border="0"><br />
<br />
<tr><br />
<br />
<td width="10"><br />
</td><br />
<br />
<td width="760"><br />
<br />
<TABLE id="tblLocation" cellSpacing="0" cellPadding="0" width="100%" border="0"><br />
<tr height="25"><br />
<br />
<td width="20%"></td><br />
<br />
<td width="50%"><br />
<br />
<asp:CheckBox id="chk1" runat="server" Text="CheckOnce"></asp:CheckBox><br />
<br />
</td> <br />
<br />
<td width="30%"></td><br />
<br />
</TR><br />
</TABLE><br />
<br />
</td><br />
<td width="10"></td><br />
</tr><br />
</TABLE><br />
Can anyone please suggest me a best way to do this?
Thanks
-- modified at 1:02 Tuesday 27th February, 2007
|
|
|
|
|
I would like to know about how to create program for user can add edit or delete field in the page.
Example now the screen Company have 4 field ( Company,Address,Phone,Fax) for user input data ,but now user want to field Zipcode . Sorry about my english.thank you.
Tospon
|
|
|
|
|
HI
Add the Editable textBoxes where you want input from User ....
Is it the thing you wanted ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Yes , but i don't know about design for coding. I'm begining develop.I used asp.net framework 2. Thank you
Tospon
|
|
|
|
|
Oops !
Certainly wrong question
Please go through some examples and do dome Tutorials that will help you :->
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Thank you for comment.
Tospon
|
|
|
|
|
Hi
sorry for posting the new thread,reply is not working properly in my pc
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.load("class.xml");
var x=xmlDoc.getElementsByTagName("class");
var newel;
for (i=0;i
|
|
|
|
|
HI Karan
Can you provide Schema of your xml ,
can you tell where exact it is giving error you can check that by adding alert box
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Hi ALL:
I've created a simple web site. There was a Log.aspx page that have hyperlink for user to signup.aspx. By default, ASPNETDB.MDF was created by VS2005. Anyway I got this messaged "Failed to update database "C:\INETPUB\WWWROOT\SQA\APP_DATA\ASPNETDB.MDF" because the database is read-only. "
I'd tried to uncheck the read-only on the folder but didn't help.
Please help!
Thanks in advance.
Eyungwah.
|
|
|
|
|
I have an aspx page I want to pass a Color. How do I do this from another aspx page. I already am accepting some string and int parameters through QueryString. Can I continue to do it that way?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
You can get the color as an integer value using the ToArgb method, and turn the integer back to a color using the FromArgb method.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi.
1. Is there any code which will list the installed frameworks on server (asp.net)?
and
2. How can I list all installed browsers on system?
Thanks.
|
|
|
|
|
write code to
1.Listout the directories existing in C:\WINDOWS\Microsoft.NET\Framework
2.Check the folder name starts with small v
3.Parse the folder name and take the version.
I know this is a shortcut way of taking the versions. But I dont know how to take it in other way.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
Score it if you like my post
|
|
|
|
|
Thanks for reply.
Do you think this will work on server since I don't know which letter represents system partition and since I am surely restricted to read Windows folder on server?
|
|
|
|
|
|
I saw that article, but uses registry.
I don't think that will work either.
I know that I can see fw version by making an error and then fw version will be displayed, but that isn't very good approach.
Thanks for reply.
|
|
|
|
|
Hi.
How can I use a dataview(or any other object that can I edit template it) with paging ?
Gridview has paging but I can't edit template it!
Best wishes
|
|
|
|
|
You can use datagridview for paging and editing purpose also.
Sathesh Pandian
|
|
|
|