473,396 Members | 1,970 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,396 software developers and data experts.

to add a character value to datarow in vb.net

21
hi
can anyone let me know
how to add a character value to datarow.item
for example
i wanted to add a status field value with "S" then how can i add it using vb.net
i did in many ways but its still showing value=nothing

Expand|Select|Wrap|Line Numbers
  1.                     drTemp1 = dlog2.NewRow
  2.                     drTemp1.Item("status") = "'P'"
  3.                     drTemp1.Item("errMsg") = errMsg
  4.                     dlog2.Rows.Add(drTemp1)
  5.  
i want to add errMsg values and Status = P
i tried with "P" and also convert.tostring("P")
but its just showing me status= nothing
Please let me know

thanks
Dec 3 '07 #1
2 4396
nateraaaa
663 Expert 512MB
hi
can anyone let me know
how to add a character value to datarow.item
for example
i wanted to add a status field value with "S" then how can i add it using vb.net
i did in many ways but its still showing value=nothing

Expand|Select|Wrap|Line Numbers
  1.                     drTemp1 = dlog2.NewRow
  2.                     drTemp1.Item("status") = "'P'"
  3.                     drTemp1.Item("errMsg") = errMsg
  4.                     dlog2.Rows.Add(drTemp1)
  5.  
i want to add errMsg values and Status = P
i tried with "P" and also convert.tostring("P")
but its just showing me status= nothing
Please let me know

thanks
What is dlog2? Is it a datatable? To add a row column try this:
Expand|Select|Wrap|Line Numbers
  1. drTemp1 = dlog2.NewRow
  2. drTemp1("status") = "'P'"
  3. drTemp1("errMsg") = errMsg
  4. dlog2.Rows.Add(drTemp1)
Nathan
Dec 4 '07 #2
riyap
21
What is dlog2? Is it a datatable? To add a row column try this:
Expand|Select|Wrap|Line Numbers
  1. drTemp1 = dlog2.NewRow
  2. drTemp1("status") = "'P'"
  3. drTemp1("errMsg") = errMsg
  4. dlog2.Rows.Add(drTemp1)
Nathan
Thanks for the response
i used "P" as you said that was working but
my doubt is how to update this data table in msaccess DB using vb.net
i used
datatables dlog3 has selected values(i.select command values) and dlog2 has updated values(changed new values) so how to relate these 2 datatables and update in db table
if possible can u give me the code
its would be really helpfull
Expand|Select|Wrap|Line Numbers
  1. comm=select * from logtable where status="S""
  2. da1.SelectCommand = comm
  3. count1 = da1.Fill(dlog3)
  4. da1.UpdateCommand = cmdBuilder.GetUpdateCommand()
  5.   da1.Update(dlog3)
  6.  
so to relate 2 datatables and update the vlaues
Dec 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Martin Lindén | last post by:
I got this example written by David J Gottlieb. Which will not compile. I have previously read in the xml doc with myDataSet.ReadXML(Server.MapPath("bills.xml")) Then when i com to this...
3
by: Carl Lindmark | last post by:
*Cross-posting from microsoft.public.dotnet.languages.csharp, since I believe the question is better suited in this XML group* Hello all, I'm having some problems understanding all the ins and...
0
by: Shravan | last post by:
Hi, I have a extended datagrid, in which I am setting values at a given cell in the grid using grid = val; The grid has NewRow creation set to false But sometimes setting value at a...
1
by: MrNobody | last post by:
I seem to be having trouble trying to select the right value in a ComboBox DataSourced by a DataTable with a value for a DataRow... For example... In a Windows Form, I have a ComboBox: ...
3
by: Chet | last post by:
I have a DataRow from a table in a data set. One of the columns has a name of "COMPANY_TICKET_ID" and I'm trying to get this column's value with the following: foreach( DataRow row in...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
8
by: stephane8 | last post by:
I'm able to open and read my .csv file. But when the character "-" is in one of my fields (ex : 18802-002) I get a system.DBNull value ! Even if I edit the file with notepad and put "18802-002" I...
3
by: Niyazi | last post by:
Hi all, I have a dataTable that contains nearly 38400 rows. In the dataTable consist of 3 column. column 1 Name: MUHNO column 2 Name: HESNO Column 3 Name: BALANCE Let me give you some...
6
by: Manikandan | last post by:
Hi, I need to insert the datetime with milliseconds value into a datarow. My code as below DataTable testDataTable=new DataTable(); testDataTable.Columns.Add("updatedDateTime",...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.