|
I suspect that is because of the trinary operator that you are using. These are generally considered to be bad practice.
Try this:
if (this.tbSpeed.Text == "")
dataRow["SPEED"] = DBNull.Value;
else
dataRow["SPEED"] = this.tbSpeed.Text;
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
And I'd guess that that the contents of the text box will need to be converted to a decimal also.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Try this:
dataRow["Speed"] = this.tbSpeed.Text ?? (object) DBNull.Value;
|
|
|
|
|
IF you would use a simple "IF", it would be very simple.
|
|
|
|
|
I have used this even then i am getting the same error
if (this.tbSpeed.Text == "")
dataRow["SPEED"] = DBNull.Value;//"NULL";
else
dataRow["SPEED"] = this.tbSpeed.Text;
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
Your manner of storing values in the database seems pretty unusual. I would create a command with an "INSERT" statement as the command text and call it's ExecuteNonQuery() method. For the decimal column I would use an SQL Parameter of decimal type to avoid format errors.
|
|
|
|
|
I have found the solution... Just applied the validation when creating the query string and it works fine to specify NUll for an empty string.
I am doing in the same way you are saying
but i have a seperate class that deals with it when provided with a data row.
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
how can i divide a windows forms in two half horizontally. The upper half contains one listview control and the lower half contains another list view control. and how can i manage the size when the form is expanded making sure that two list view doest overlap each other(i.e when form is expanded);
|
|
|
|
|
You can use a split container. It's in the toolbox. It creates two panels that you can put your controls into with a resizable divider. It ensures that the controls don't overlap. You can set it to be horizonal or vertical.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
is it availabe in dotnet 2003 or frame work 1.1
|
|
|
|
|
justintimberlake wrote: is it availabe in dotnet 2003 or frame work 1.1
According to MSDN[^] the answer is no.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
No, it isn't, but the Splitter control is.
You can simply add two Panels and a Splitter to your form to achieve a similar effect with .NET 1.1.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I installed the SQL Server 2005 with all components.
I need to do practice in that IDE As i study.but it not new->project template as i saw...it is same as visual studio 2005.
i neet BI IDE templates as its(default)
SQL Server Business Intelligence Development Studio.
Thanks in advance!
|
|
|
|
|
This does not appear to be a question about C#. Try posting in a more appropriate forum.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
hi guys
i am doing the following but it does not work, there is no error or exception
but the file acees rights are not changes, means i cant allow or deny file access rights with this code in my application, i m pasting the code plz help me out there?
FileSecurity fs = System.IO.File.GetAccessControl(@"\\Jpak02\Comm for ITS\TAhmad",
AccessControlSections.Access);
FileSystemAccessRule ar = new FileSystemAccessRule
("mkhkhan", FileSystemRights.Modify, AccessControlType.Allow);
fs.AddAccessRule(ar);
it doest not work,,
thanks in advance
best regards
hello
|
|
|
|
|
Hi folks,
I am new to the sharepoint 2007 and i would like to create blog site using sharepoint API in my C# application.Please give the URLs or code snippet to create blog site using sharepoint API.
Thanks in advance.
Kiran Kumar.CH
(MCP)
|
|
|
|
|
Hi
I am using Visual Studio 2005 and C#. In my Windows application I load data from database into a DataSet. Is there a way to determine which DataRow in a DataTable caused an error when you update the database via a DataAdapter? What I would like to do is display to the user a short report when the update fails so that he can see which DataRow caused a problem.
Thanks.
Kobus
|
|
|
|
|
there is a datatype of varchar(max) in an input parameter of a stored procedure in sql server 2005 that I am using.
What datatype should I pass via C# to sql server for this varchar(max)?
This is what I have at present but it does not work.
param = comm.CreateParameter();
param.ParameterName = "doc";
param.Value = strXML;
param.DbType = DbType.AnsiString;
param.Size = 50000;
comm.Parameters.Add(param);
|
|
|
|
|
I have a usercontrol in form1 which has a button in it. When user press this button I create a FORM class and add my usercontrol to it with the code below:
private void MaximizeButton_Click(object sender, EventArgs e) {
Form form = new Form();
Control c = this.Parent;
form.Controls.Add(c);
form.Controls[0].Dock = DockStyle.Fill;
form.Controls[0].Location = new Point(0, 0);
form.ShowDialog();
}
The second form shown correctly but the problem is the UserControl disappear from the main form. Any idea?
Thanks
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
hi,
you add contol to form,,you should add user control to form .
<br />
private void MaximizeButton_Click(object sender, EventArgs e)<br />
{<br />
userControl1 c = new userControl1();<br />
c.Dock = DockStyle.Fill;<br />
c.Location = new Point(0, 0);<br />
Form form = new Form();<br />
form.Controls.Add(c);<br />
form.ShowDialog();<br />
}<br />
|
|
|
|
|
Thanks ,it works now but I have one more problem. This button will be placed inside different type of UserControls, so how can get which UserControl should be create other that using a factory for my constructors?
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
i don't understand exactly ,please explain more
phone number : 09124603315
-- modified at 7:36 Monday 25th June, 2007
|
|
|
|
|
Hi,
I want to improve the following query's performance executing on sqlce.
select *
from TABLE_A
where field_a in (select field_a
from TABLE_B
where field_b = '0000162080'
and field_c = '2'
and field_d = '011')
order by field_e
Table_A has index for field_a and Table_B has index for field_b and field_c. How can I rewrite the query to execute faster?
thanks,
- ferudun
|
|
|
|
|
I have a custom section defined in the app.config of my application and I want to read the parameters and store the values in a custom class, but I find that the code for ConfigurationManager.GetSection()
returns a null value, and I can't find the reason.
the full code is the following:
<br />
public class WSProvidersFactory : IConfigurationSectionHandler <br />
{<br />
<br />
public object Create(object parent, <br />
object configContext, System.Xml.XmlNode section)<br />
{<br />
WSProvider objProvider = new WSProvider();<br />
objProvider.Name = section.SelectSingleNode("Name").InnerText;<br />
objProvider.Type = section.SelectSingleNode("Type").InnerText;<br />
objProvider.Url = section.SelectSingleNode("Url").InnerText;<br />
return objProvider;<br />
}<br />
public static string GetProviderUrl(ServiceType _typeService)<br />
{<br />
WSProvider _provider = null;<br />
<br />
switch (_typeService)<br />
{<br />
case ServiceType .Local:<br />
throw new Exception("Not Implemented."); <br />
case ServiceType.MainWS:<br />
_provider = (WSProvider)System.Configuration.ConfigurationManager.GetSection<br />
("WebServiceClientProviders/WsNetTiersProviderPrincipal");<br />
break;<br />
case ServiceType.AltWS:<br />
_provider = (WSProvider)System.Configuration.ConfigurationManager.GetSection<br />
("WebServiceClientProviders/WsNetTiersProviderSecundario");<br />
break;<br />
}<br />
return _provider.Url;<br />
}<br />
<br />
[Serializable]<br />
private class WSProvider <br />
{<br />
private string _name;<br />
<br />
public string Name<br />
{<br />
get { return _name; }<br />
set { _name = value; }<br />
}<br />
private string _type;<br />
<br />
public string Type<br />
{<br />
get { return _type; }<br />
set { _type = value; }<br />
}<br />
private string _url;<br />
<br />
public string Url<br />
{<br />
get { return _url; }<br />
set { _url = value; }<br />
}<br />
}<br />
}<br />
AND the code in the app.config file is this:
<<configuration><br />
<<configSections><br />
<<section name="WebServiceClientProviders"<br />
type="ConfigSections.MyConfigHandler,ConfigSections"/><br />
<</configSections><br />
<connectionStrings><br />
<add name="netTiersConnectionString" connectionString="Server=(local);Database=Application_Prueba;Trusted_Connection=True;" /> <br />
</connectionStrings><br />
<br />
</Application.Pruebas.Data><br />
<WebServiceClientProviders><br />
<!-- <br />
*** WebserviceClient Provider ***<br />
The url parameter indicates the webservices url (ex: http:
--><br />
<WsNetTiersProviderPrincipal><br />
<name>WsNetTiersProviderPrincipal"</name><br />
<type>Application.Pruebas.Data.WebServiceClient.WsNetTiersProvider, Application.Pruebas.Data.WebServiceClient"</type><br />
<url>http:
</WsNetTiersProviderPrincipal><br />
<br />
<WsNetTiersProviderSecundario><br />
<name>WsNetTiersProviderSecundario"</name><br />
<type>Application.Pruebas.Data.WebServiceClient.WsNetTiersProvider, Application.Pruebas.Data.WebServiceClient"</type><br />
<url>http:
</WsNetTiersProviderSecundario><br />
<br />
</WebServiceClientProviders><br />
<br />
</configuration><br />
What am I doing wrong?
|
|
|
|
|
<a href="http://www.codeproject.com/useritems/Send_SMS.asp?df=100&forumid=379162&select=2097796&msg=2097796">http://www.codeproject.com/useritems/Send_SMS.asp?df=100&forumid=379162&select=2097796&msg=2097796</a>.
I referred this link to send sms.It works fine but the messages are not going toa mobile from my application.can any one help me?.
Hi,Im Razana
|
|
|
|