473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

cannot implicitly convert type object to string

Hi,

I am receiving the error when compiling the project, "cannot implicitly
convert type object to string".

The error points to this line of code and underlines the
dtrRecipient["Email"]: objMailMessage.To = dtrRecipient["Email"];

I'm not sure why I am getting this error. Below is the complete code I am
working with.

private void EmailEm()
{
string intSelectedEmail = ddlChooseEmail.SelectedValue.ToString();
string sqlGetEmail = "SELECT content, subject FROM tblContent WHERE id =
" + intSelectedEmail;
SqlCommand cmdGetEmail = new SqlCommand(sqlGetEmail, strConnString);
SqlDataReader dtrEmail = cmdGetEmail.ExecuteReader();

string intSelectedGroup = chkGroups.SelectedValue.ToString();
string sqlRECIPIENTS = "SELECT tblRecipients.Email AS Email FROM tblGR
INNER JOIN tblRecipients ON tblGR.RecipientID = tblRecipients.ID WHERE
tblGR.GroupID=" + intSelectedGroup;
SqlCommand cmdSelect = new SqlCommand( sqlRECIPIENTS, strConnString );
SqlDataReader dtrRecipient = cmdSelect.ExecuteReader();

MailMessage objMailMessage;

while (dtrRecipient.Read())
{
// Create the Mail Message
objMailMessage = new MailMessage();
objMailMessage.From = "";
objMailMessage.To = dtrRecipient["Email"];
objMailMessage.Subject = dtrEmail["Subject"];
objMailMessage.Body = dtrEmail["Content"];

// Send the Mail Message
SmtpMail.Send( objMailMessage );
}
}
Thanks,

Andy
Nov 19 '05 #1
9 10505
Andy,
You simply can covert something of type System.Object to something of type
System.String. The "Email" column might be a varchar, but dr["xxx"] always
returns an object. you must Convert it to the type you wish:

objMailMessage.To = Convert.ToString(dtrRecipient["Email"]);

If you were using vb before, you could get away from doing this by having
Option Strict Off - but then your in for all sorts of trouble..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andy Sutorius" <an**@sutorius.com> wrote in message
news:6z*********************@twister.southeast.rr. com...
Hi,

I am receiving the error when compiling the project, "cannot implicitly
convert type object to string".

The error points to this line of code and underlines the
dtrRecipient["Email"]: objMailMessage.To = dtrRecipient["Email"];

I'm not sure why I am getting this error. Below is the complete code I am
working with.

private void EmailEm()
{
string intSelectedEmail = ddlChooseEmail.SelectedValue.ToString();
string sqlGetEmail = "SELECT content, subject FROM tblContent WHERE id = " + intSelectedEmail;
SqlCommand cmdGetEmail = new SqlCommand(sqlGetEmail, strConnString);
SqlDataReader dtrEmail = cmdGetEmail.ExecuteReader();

string intSelectedGroup = chkGroups.SelectedValue.ToString();
string sqlRECIPIENTS = "SELECT tblRecipients.Email AS Email FROM tblGR
INNER JOIN tblRecipients ON tblGR.RecipientID = tblRecipients.ID WHERE
tblGR.GroupID=" + intSelectedGroup;
SqlCommand cmdSelect = new SqlCommand( sqlRECIPIENTS, strConnString );
SqlDataReader dtrRecipient = cmdSelect.ExecuteReader();

MailMessage objMailMessage;

while (dtrRecipient.Read())
{
// Create the Mail Message
objMailMessage = new MailMessage();
objMailMessage.From = "";
objMailMessage.To = dtrRecipient["Email"];
objMailMessage.Subject = dtrEmail["Subject"];
objMailMessage.Body = dtrEmail["Content"];

// Send the Mail Message
SmtpMail.Send( objMailMessage );
}
}
Thanks,

Andy

Nov 19 '05 #2
Let me guess: You used to be a VB programmer, right?

When you use the indexer for a SqlDataReader, you are invoking the "Item"
method, which returns a type of "Object." As an object is not a string, you
can't simply assign it to a string. That would be an implicit conversion.
You have to either do an explicit conversion (using Convert) or, better yet,
use the approproate SqlDataReader methods for getting the correct type of
data out of the row, such as .GetString().

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Andy Sutorius" <an**@sutorius.com> wrote in message
news:6z*********************@twister.southeast.rr. com...
Hi,

I am receiving the error when compiling the project, "cannot implicitly
convert type object to string".

The error points to this line of code and underlines the
dtrRecipient["Email"]: objMailMessage.To = dtrRecipient["Email"];

I'm not sure why I am getting this error. Below is the complete code I am
working with.

private void EmailEm()
{
string intSelectedEmail = ddlChooseEmail.SelectedValue.ToString();
string sqlGetEmail = "SELECT content, subject FROM tblContent WHERE id =
" + intSelectedEmail;
SqlCommand cmdGetEmail = new SqlCommand(sqlGetEmail, strConnString);
SqlDataReader dtrEmail = cmdGetEmail.ExecuteReader();

string intSelectedGroup = chkGroups.SelectedValue.ToString();
string sqlRECIPIENTS = "SELECT tblRecipients.Email AS Email FROM tblGR
INNER JOIN tblRecipients ON tblGR.RecipientID = tblRecipients.ID WHERE
tblGR.GroupID=" + intSelectedGroup;
SqlCommand cmdSelect = new SqlCommand( sqlRECIPIENTS, strConnString );
SqlDataReader dtrRecipient = cmdSelect.ExecuteReader();

MailMessage objMailMessage;

while (dtrRecipient.Read())
{
// Create the Mail Message
objMailMessage = new MailMessage();
objMailMessage.From = "";
objMailMessage.To = dtrRecipient["Email"];
objMailMessage.Subject = dtrEmail["Subject"];
objMailMessage.Body = dtrEmail["Content"];

// Send the Mail Message
SmtpMail.Send( objMailMessage );
}
}
Thanks,

Andy

Nov 19 '05 #3
Guilty of being a vb programmer :-)

Thanks to both of you for your help!

Andy
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
Let me guess: You used to be a VB programmer, right?

When you use the indexer for a SqlDataReader, you are invoking the "Item"
method, which returns a type of "Object." As an object is not a string, you can't simply assign it to a string. That would be an implicit conversion.
You have to either do an explicit conversion (using Convert) or, better yet, use the approproate SqlDataReader methods for getting the correct type of
data out of the row, such as .GetString().

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Andy Sutorius" <an**@sutorius.com> wrote in message
news:6z*********************@twister.southeast.rr. com...
Hi,

I am receiving the error when compiling the project, "cannot implicitly
convert type object to string".

The error points to this line of code and underlines the
dtrRecipient["Email"]: objMailMessage.To = dtrRecipient["Email"];

I'm not sure why I am getting this error. Below is the complete code I am working with.

private void EmailEm()
{
string intSelectedEmail = ddlChooseEmail.SelectedValue.ToString();
string sqlGetEmail = "SELECT content, subject FROM tblContent WHERE id = " + intSelectedEmail;
SqlCommand cmdGetEmail = new SqlCommand(sqlGetEmail, strConnString);
SqlDataReader dtrEmail = cmdGetEmail.ExecuteReader();

string intSelectedGroup = chkGroups.SelectedValue.ToString();
string sqlRECIPIENTS = "SELECT tblRecipients.Email AS Email FROM tblGR
INNER JOIN tblRecipients ON tblGR.RecipientID = tblRecipients.ID WHERE
tblGR.GroupID=" + intSelectedGroup;
SqlCommand cmdSelect = new SqlCommand( sqlRECIPIENTS, strConnString );
SqlDataReader dtrRecipient = cmdSelect.ExecuteReader();

MailMessage objMailMessage;

while (dtrRecipient.Read())
{
// Create the Mail Message
objMailMessage = new MailMessage();
objMailMessage.From = "";
objMailMessage.To = dtrRecipient["Email"];
objMailMessage.Subject = dtrEmail["Subject"];
objMailMessage.Body = dtrEmail["Content"];

// Send the Mail Message
SmtpMail.Send( objMailMessage );
}
}
Thanks,

Andy


Nov 19 '05 #4
Doesn't .GetString() require an ordinal position, which, in my opinion
wouldn't make it a "better" choice, just an alternative one with its own
pros and cons

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
Let me guess: You used to be a VB programmer, right?

When you use the indexer for a SqlDataReader, you are invoking the "Item"
method, which returns a type of "Object." As an object is not a string, you can't simply assign it to a string. That would be an implicit conversion.
You have to either do an explicit conversion (using Convert) or, better yet, use the approproate SqlDataReader methods for getting the correct type of
data out of the row, such as .GetString().

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Andy Sutorius" <an**@sutorius.com> wrote in message
news:6z*********************@twister.southeast.rr. com...
Hi,

I am receiving the error when compiling the project, "cannot implicitly
convert type object to string".

The error points to this line of code and underlines the
dtrRecipient["Email"]: objMailMessage.To = dtrRecipient["Email"];

I'm not sure why I am getting this error. Below is the complete code I am working with.

private void EmailEm()
{
string intSelectedEmail = ddlChooseEmail.SelectedValue.ToString();
string sqlGetEmail = "SELECT content, subject FROM tblContent WHERE id = " + intSelectedEmail;
SqlCommand cmdGetEmail = new SqlCommand(sqlGetEmail, strConnString);
SqlDataReader dtrEmail = cmdGetEmail.ExecuteReader();

string intSelectedGroup = chkGroups.SelectedValue.ToString();
string sqlRECIPIENTS = "SELECT tblRecipients.Email AS Email FROM tblGR
INNER JOIN tblRecipients ON tblGR.RecipientID = tblRecipients.ID WHERE
tblGR.GroupID=" + intSelectedGroup;
SqlCommand cmdSelect = new SqlCommand( sqlRECIPIENTS, strConnString );
SqlDataReader dtrRecipient = cmdSelect.ExecuteReader();

MailMessage objMailMessage;

while (dtrRecipient.Read())
{
// Create the Mail Message
objMailMessage = new MailMessage();
objMailMessage.From = "";
objMailMessage.To = dtrRecipient["Email"];
objMailMessage.Subject = dtrEmail["Subject"];
objMailMessage.Body = dtrEmail["Content"];

// Send the Mail Message
SmtpMail.Send( objMailMessage );
}
}
Thanks,

Andy


Nov 19 '05 #5
> Doesn't .GetString() require an ordinal position, which, in my opinion
wouldn't make it a "better" choice, just an alternative one with its own
pros and cons
Well, Karl, I'm sure that's debateable. Yes, it does require an Ordinal
position, and I generally use it with GetOrdinal(), as in:

objMailMessage.To =
dtrRecipient.GetString(dtrRecipient.GetOrdinal("Em ail"));

If you're going to use the same column more than once, you can set an
integer variable for the ordinal to save some cycles.

As an old C programmer, I tend to avoid anything that works with Object.
However, on reflection, I couldn't say for sure which was more efficient at
run-time. I would think that Conversion functions have higher overhead, but
I have no proof.
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OB*************@TK2MSFTNGP15.phx.gbl... Doesn't .GetString() require an ordinal position, which, in my opinion
wouldn't make it a "better" choice, just an alternative one with its own
pros and cons

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
Let me guess: You used to be a VB programmer, right?

When you use the indexer for a SqlDataReader, you are invoking the "Item"
method, which returns a type of "Object." As an object is not a string,

you
can't simply assign it to a string. That would be an implicit conversion.
You have to either do an explicit conversion (using Convert) or, better

yet,
use the approproate SqlDataReader methods for getting the correct type of
data out of the row, such as .GetString().

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Andy Sutorius" <an**@sutorius.com> wrote in message
news:6z*********************@twister.southeast.rr. com...
> Hi,
>
> I am receiving the error when compiling the project, "cannot implicitly
> convert type object to string".
>
> The error points to this line of code and underlines the
> dtrRecipient["Email"]: objMailMessage.To = dtrRecipient["Email"];
>
> I'm not sure why I am getting this error. Below is the complete code I am > working with.
>
> private void EmailEm()
> {
> string intSelectedEmail = ddlChooseEmail.SelectedValue.ToString();
> string sqlGetEmail = "SELECT content, subject FROM tblContent WHERE
> id = > " + intSelectedEmail;
> SqlCommand cmdGetEmail = new SqlCommand(sqlGetEmail, strConnString);
> SqlDataReader dtrEmail = cmdGetEmail.ExecuteReader();
>
> string intSelectedGroup = chkGroups.SelectedValue.ToString();
> string sqlRECIPIENTS = "SELECT tblRecipients.Email AS Email FROM
> tblGR
> INNER JOIN tblRecipients ON tblGR.RecipientID = tblRecipients.ID WHERE
> tblGR.GroupID=" + intSelectedGroup;
> SqlCommand cmdSelect = new SqlCommand( sqlRECIPIENTS,
> strConnString );
> SqlDataReader dtrRecipient = cmdSelect.ExecuteReader();
>
> MailMessage objMailMessage;
>
> while (dtrRecipient.Read())
> {
> // Create the Mail Message
> objMailMessage = new MailMessage();
> objMailMessage.From = "";
> objMailMessage.To = dtrRecipient["Email"];
> objMailMessage.Subject = dtrEmail["Subject"];
> objMailMessage.Body = dtrEmail["Content"];
>
> // Send the Mail Message
> SmtpMail.Send( objMailMessage );
> }
> }
>
>
> Thanks,
>
> Andy
>
>



Nov 19 '05 #6
On Tue, 22 Feb 2005 09:03:44 -0500, "Kevin Spencer"
<ke***@DIESPAMMERSDIEtakempis.com> wrote:
Doesn't .GetString() require an ordinal position, which, in my opinion
wouldn't make it a "better" choice, just an alternative one with its own
pros and cons


Well, Karl, I'm sure that's debateable. Yes, it does require an Ordinal
position, and I generally use it with GetOrdinal(), as in:

objMailMessage.To =
dtrRecipient.GetString(dtrRecipient.GetOrdinal("E mail"));

If you're going to use the same column more than once, you can set an
integer variable for the ordinal to save some cycles.

As an old C programmer, I tend to avoid anything that works with Object.
However, on reflection, I couldn't say for sure which was more efficient at
run-time. I would think that Conversion functions have higher overhead, but
I have no proof.
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.


Would I be correct in saying the ordinal is faster though? I tend to
use ordinals in comination with some column name constants.

I

--
Iain Norman | http://www.eliteforum.org
Nov 19 '05 #7
I would think that if you use a typed method such as GetString() with a
literal or variable Ordinal, it would be faster. Again, I have no proof. But
there is no conversion involved, so I would tend to think it was faster.
What I was doubtful about was whether using a typed method with the
GetOrdinal() method would be faster, as in:

objMailMessage.To =
dtrRecipient.GetString(dtrRecipient.GetOrdinal("Em ail"));

This requires 2 method calls for each column.

Still, the GetOrdinal() method just loops through the columns to find one
with the name specified, so it can't be too expensive. I just can't say with
any authority whether the 2 method calls to get the typed value are more
efficient than the 2 method calls using Convert (1 call to the Item()
method, plus 1 call to Convert). My guts tell me that the first alternative
would be faster, since Conversion functions have to use Reflection to derive
the type of the object.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Iain Norman" <an******@me.com> wrote in message
news:ln********************************@4ax.com...
On Tue, 22 Feb 2005 09:03:44 -0500, "Kevin Spencer"
<ke***@DIESPAMMERSDIEtakempis.com> wrote:
Doesn't .GetString() require an ordinal position, which, in my opinion
wouldn't make it a "better" choice, just an alternative one with its own
pros and cons


Well, Karl, I'm sure that's debateable. Yes, it does require an Ordinal
position, and I generally use it with GetOrdinal(), as in:

objMailMessage.To =
dtrRecipient.GetString(dtrRecipient.GetOrdinal(" Email"));

If you're going to use the same column more than once, you can set an
integer variable for the ordinal to save some cycles.

As an old C programmer, I tend to avoid anything that works with Object.
However, on reflection, I couldn't say for sure which was more efficient
at
run-time. I would think that Conversion functions have higher overhead,
but
I have no proof.
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.


Would I be correct in saying the ordinal is faster though? I tend to
use ordinals in comination with some column name constants.

I

--
Iain Norman | http://www.eliteforum.org

Nov 19 '05 #8
I have seen test about this, and GetXXX is faster when looping through
records but slower when doing a single record. Can't find the link though
:(

The point I was trying to make is that the performance difference is
incredibly small in both cases for most typical usage (I mean, if ur looping
through 1000 records, then it might start to be a factor, and this probably
isn't at all uncomon, but I still wouldn't call it "typical"). I believe,
with such a small difference, the rule should be maintainability, the
exception performance.

GetXXX(y) by itself, in my opinion, is pretty bad for maintenance. (a) you
don't know what field it's actually getting, (b) it can easily break.
using GetXXX with GetOrdinal however is pretty much are maintainable as the
explicit column names, so the performance benefits are probably key... In
the initial post Kevin didn't make mention of GetOrdinal which I guess is
why I though it necessary to raise a flag (besides, I've never been invovled
in one of Kevin's long threads and thought this could be my chance!)

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OZ**************@TK2MSFTNGP14.phx.gbl...
I would think that if you use a typed method such as GetString() with a
literal or variable Ordinal, it would be faster. Again, I have no proof. But there is no conversion involved, so I would tend to think it was faster.
What I was doubtful about was whether using a typed method with the
GetOrdinal() method would be faster, as in:

objMailMessage.To =
dtrRecipient.GetString(dtrRecipient.GetOrdinal("Em ail"));

This requires 2 method calls for each column.

Still, the GetOrdinal() method just loops through the columns to find one
with the name specified, so it can't be too expensive. I just can't say with any authority whether the 2 method calls to get the typed value are more
efficient than the 2 method calls using Convert (1 call to the Item()
method, plus 1 call to Convert). My guts tell me that the first alternative would be faster, since Conversion functions have to use Reflection to derive the type of the object.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Iain Norman" <an******@me.com> wrote in message
news:ln********************************@4ax.com...
On Tue, 22 Feb 2005 09:03:44 -0500, "Kevin Spencer"
<ke***@DIESPAMMERSDIEtakempis.com> wrote:
Doesn't .GetString() require an ordinal position, which, in my opinion
wouldn't make it a "better" choice, just an alternative one with its own pros and cons

Well, Karl, I'm sure that's debateable. Yes, it does require an Ordinal
position, and I generally use it with GetOrdinal(), as in:

objMailMessage.To =
dtrRecipient.GetString(dtrRecipient.GetOrdinal(" Email"));

If you're going to use the same column more than once, you can set an
integer variable for the ordinal to save some cycles.

As an old C programmer, I tend to avoid anything that works with Object.
However, on reflection, I couldn't say for sure which was more efficient
at
run-time. I would think that Conversion functions have higher overhead,
but
I have no proof.
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.


Would I be correct in saying the ordinal is faster though? I tend to
use ordinals in comination with some column name constants.

I

--
Iain Norman | http://www.eliteforum.org


Nov 19 '05 #9
Karl,

Your logic is impeccable. :)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:ul****************@TK2MSFTNGP14.phx.gbl...
I have seen test about this, and GetXXX is faster when looping through
records but slower when doing a single record. Can't find the link though
:(

The point I was trying to make is that the performance difference is
incredibly small in both cases for most typical usage (I mean, if ur
looping
through 1000 records, then it might start to be a factor, and this
probably
isn't at all uncomon, but I still wouldn't call it "typical"). I believe,
with such a small difference, the rule should be maintainability, the
exception performance.

GetXXX(y) by itself, in my opinion, is pretty bad for maintenance. (a)
you
don't know what field it's actually getting, (b) it can easily break.
using GetXXX with GetOrdinal however is pretty much are maintainable as
the
explicit column names, so the performance benefits are probably key... In
the initial post Kevin didn't make mention of GetOrdinal which I guess is
why I though it necessary to raise a flag (besides, I've never been
invovled
in one of Kevin's long threads and thought this could be my chance!)

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OZ**************@TK2MSFTNGP14.phx.gbl...
I would think that if you use a typed method such as GetString() with a
literal or variable Ordinal, it would be faster. Again, I have no proof.

But
there is no conversion involved, so I would tend to think it was faster.
What I was doubtful about was whether using a typed method with the
GetOrdinal() method would be faster, as in:

objMailMessage.To =
dtrRecipient.GetString(dtrRecipient.GetOrdinal("Em ail"));

This requires 2 method calls for each column.

Still, the GetOrdinal() method just loops through the columns to find one
with the name specified, so it can't be too expensive. I just can't say

with
any authority whether the 2 method calls to get the typed value are more
efficient than the 2 method calls using Convert (1 call to the Item()
method, plus 1 call to Convert). My guts tell me that the first

alternative
would be faster, since Conversion functions have to use Reflection to

derive
the type of the object.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Iain Norman" <an******@me.com> wrote in message
news:ln********************************@4ax.com...
> On Tue, 22 Feb 2005 09:03:44 -0500, "Kevin Spencer"
> <ke***@DIESPAMMERSDIEtakempis.com> wrote:
>
>>> Doesn't .GetString() require an ordinal position, which, in my
>>> opinion
>>> wouldn't make it a "better" choice, just an alternative one with its own >>> pros and cons
>>
>>Well, Karl, I'm sure that's debateable. Yes, it does require an Ordinal
>>position, and I generally use it with GetOrdinal(), as in:
>>
>>objMailMessage.To =
>>dtrRecipient.GetString(dtrRecipient.GetOrdinal(" Email"));
>>
>>If you're going to use the same column more than once, you can set an
>>integer variable for the ordinal to save some cycles.
>>
>>As an old C programmer, I tend to avoid anything that works with
>>Object.
>>However, on reflection, I couldn't say for sure which was more
>>efficient
>>at
>>run-time. I would think that Conversion functions have higher overhead,
>>but
>>I have no proof.
>>
>>
>>Kevin Spencer
>>Microsoft MVP
>>.Net Developer
>>Neither a follower nor a lender be.
>>
>
> Would I be correct in saying the ordinal is faster though? I tend to
> use ordinals in comination with some column name constants.
>
> I
>
> --
> Iain Norman | http://www.eliteforum.org



Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Anita C | last post by:
I have the foll. code to update the value of an attribute: xmlDocument.Load("abc.xml"); XmlAttribute xmlAttrib = xmlDocument.SelectSingleNode(root/web/theme/@desc); xmlAttrib.Value =...
1
by: Svyatoslav | last post by:
Hi, I have a problem with XmlNodes and my stack. It looks something like this: //declarations XmlNode node, new_node; Stack MyStack = new Stack(); //code MyStack.Push(node);
22
by: Christoph Boget | last post by:
I am getting an error (a few among many) for the following lines of code: retval.BrokerName = (( curRow == System.DBNull.Value ) ? SqlString.Null : (string)curRow ); retval.BrokerGroupId = ((...
6
by: juli | last post by:
I declared: public delegate void PaintEventHandler(object objSender,PaintEventArgs pea); and this.Paint+=new PaintEventHandler(MyPaintHandler); and the: static void MyPaintHandler(object...
2
by: Jeff | last post by:
I get the following error: Cannot implicitly convert type 'Factory.Stack.pArrayStack' to 'Factory.Stack.StackDefs.ImStack' at compile time. I thought perhaps there was a mismatch between the...
2
by: Patrick Olurotimi Ige | last post by:
When i convert:- this code from VB to C# Why do i get error "Cannot implicitly convert type 'object' to 'bool' VB --- If cmdcommand.Parameters("ReturnValue").Value = 1 Then lblStatus.Text =...
3
by: Patrick Olurotimi Ige | last post by:
compiling the code below i get the error:- Cannot implicitly convert type 'object'to 'System.Xml.XmlDocument' I'm getting the error on this line:- myXml.Document =...
7
by: groups | last post by:
This is my first foray into writing a generic method and maybe I've bitten off more than I can chew. My intent is to have a generic method that accepts a value name and that value will be...
1
by: alex21 | last post by:
Ok i am trying to use a Linq query to access a dictionary. public static Dictionary<string, Client> Clients = new Dictionary<string, Client>();Using this Linq query: IEnumerable<Staff> loginquery...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.