| Getting Data from a DataSet |
|
 |
Index ‹ DotNet ‹ ADO
|
- Previous
- 1
- Net Framework >> Looking for a book on writing ASP.NET Controls with VB.NETI am an ASP.NET developer who would like to start learning about writing
ASP.NET custom controls using VB.NET. I already have a reasonable amount of
knowledge with making ASP.NET pages, and am looking for a book specifically
on writing controls. Here are some things I would like the book to talk
about and my preferences as to how I would like it to be shown/explained:
1. I want it to use VB.NET for the examples, since that is what I write all
my sites using and have experience with.
2. I would prefer that the book use many examples, because I feel I learn
better when I see examples.
3. I want to know how to make the different properties be either displayed
or not displayed in the Visual Studio .NET Properties Palette, as well as
other things that affect the appearance in Visual Studio .NET.
4. I want it to concentrate only on ASP.NET Custom Controls.
Thank you in advance to anyone that can help me find a book on this topic.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
- 2
- Winforms >> tabPage.Focus() doesn't work?Hi,
I have a TabControl in a WinForm witn two tabs.
At some point I want to switch focus from the first TabPage to the second
TabPage.
The documentation says that any control (which seems to be the case for the
TabControl) that derives from Panel aren't selectable.
Since I think this is a simple wish I can't imagine that there shouldn't be
a workaround for that. Do you have helping ideas?
Thank you very much.
Torben
- 3
- Net Framework >> Profiling/Debugging Real Time Security ChecksI have a medium sized application (say 50k lines) that occasionally will
spike the % of time in RT security checks performance counter between 50 and
95%.
It can perform hundreds of thousands of code access security permission
checks in a few seconds in some cases.
I know that I can set a permission set on a higher level method and demand
then assert to help allieviate some of these checks, but how do I go about
determining what method to assert the permissions and which permissions to
assert?
I guess what I'd really like is to get a list of methods with the number of
calls and the number of code access security permission checks performed
(inclusive and exclusive).
Any ideas of how I can go about profiling/debugging this issue?
- 4
- Dotnet >> ASP.NET Integrated AuthenticationI'm developing a web application for our local intranet that will allow users
to pull up a webpage and update or deleted or insert records into a database
as well as run reports etc...
Our DB server is on a Win2k3 OS using SQL Server 2000
Our Web server is on a separate Win2kr OS using IIS 6
Both the servers and the clients are part of the same domain.
We've turned anonymous access off on the web and are passing the integrated
authentication from the client's machine (through their domain login). The
user has been granted all the correct permission to the database server and
the database that will be updated. However it seems like the authentication
is being passed to the web server and then the web server is passing a
different set of authentication on to the database server? The
authentication it is passing on to the database server is DOMAIN\MACHINENAME$.
If we add that machine name to the SQL Server as having permission to do the
update/delete/select we can get the app to work just fine. However, what we
want to do is to pass the clients authentication on to the database server...
not the web serverâ??s authentication.
Any help I could get would be much appreciated..... this is driving me nuts
and seems like a pretty common practice (having the db and the web on two
separate machines).
Thanks in advance.
Josh
- 5
- ADO >> Crystal Report - Page break after Report header !Hi all,
I'm actually encountering the following problem. I've got a report
with standard report header, page header and detail sections. But on
viewing mode, CR generates everytime a page break right after the
report header section, so the data start to be displayed only on the
second page. When all data could fit on only one page, it worked good.
The problem came when i added more fields, to report, needing 3 pages
at least. I don't know why, CR does this, where is it told to generate
this page break, cause the options "New page after, before" are not
checked.
Any help apreciated,
Thanks,
Mike.
- 6
- ADO >> ADO.NET 2.0 - Simple question for you...I have an ASP.NET 2.0 website. I want to write a function in ADO.NET 2.0
(VB.NET) that does the following:
1. Opens up a connection to my SqlExpress db. (The connectionstring is in
the <connectionStrings> section of my web.config)
2. Runs a query, storing results in a datatable.
3. Closes connection
Can anyone assist?
Thanks!
- 7
- Visual C#.Net >> hiding a rows in DataGridViewComboBoxColumnAfter a value from the combobox has been selected in a previous row of the
DataGridView, I would like to hide that value from being selectable in the
combobox in a new row of the DataGridView.
Here is a visual sample of what I'm trying to do:
http://oha.nu/accepted_creditcards.gif
I've found code to hide rows from DataGridView, but not from the
DataGridViewComboBoxColumn.
Any help much appreciated.
thanks,
Nik Edmiidz
- 8
- Dotnet >> Desktop will not display shortcutsI down loaded and installed iTunes update. Noted that it took a long time to
"finalize". When finished iTunes shortcut had disapeared. When I restarted
computer all shortcuts were gone from desktop.
Restore function will not restore to any point prior to install.
Shortcuts sent to desktop do not appear.
Any ideas?
--
RFP
- 9
- Dotnet >> Application FailIf I put my .exe file on my Local Network (in a Folder of course) and try to
run from my Pc which would be the causes ? such application don't Run.
I make the Wrap a COM component for Export data to MS-Excel:
Interop.Excel.dll
Interop.VBIDE.dll
Note: Only Run in my local PC
Best Regard
Mario
- 10
- Visual C#.Net >> adding icons to controlsHi!
I have made a few custom controls. E.g. I have a ColorTextBox which inherits
the TextBox class...
When I build the project and add it to the toolbar (through Add/Remove
Items) the control has
the default icon next to it...
Is there a way I can change the icon displayed in the toolbar? Through some
attribute perhaps?
Thanks...
Saso
- 11
- Visual C#.Net >> simulate copy commandHow do I run following from csharp from "server"?
copy file.txt \\server\printer1
Also how can I submit a text file print job to local print queue "printer1"?
Assuming I run copy command from server.
TIA!
- 12
- Dotnet >> .NET control event with java script handlerHi all,
I have created a .NET Windows control with c#.
I have placed the control on a HTML page within the OBJECT element.
Everything works fine up to now.
Now, I wanna implement the following stuff that the control must support.
The control must provide a method called InvokeJavaScriptFunction
The prototype of this method is:
InvokeJavaScriptFunction(<point to java script function>)
where <point to java script function> is a pointer to an existing java
script function in the HTML page.
The InvokeJavaScriptFunction method of the control is invoked within the
HTML page when the page is loading
<head>
<script language="javascript">
function MyJScriptFunction()
{
....
}
</script>
<OBJECT id="MyControl" .....>
</OBJECT>
</head>
<body onLoad="MyControl.InvokeJavaScriptFunction(MyJScriptFunction)">
.....
</body>
Inside the control.... the InvokeJavaScriptFunction is performing some stuff
and after that it should invoke the java script function on the page.
In other words, the InvokeJavaScriptFunction takes some actions and then it
must turn back the control on the page invoking the script function.
You can think at this like to an event.. the InvokeJavaScriptFunction is
doing its job and then fires an event on the page, where the handler of the
event is the provided java script function.
Do you have any idea how to implement this must have functionality of my
control?
Thanks,
Mircea
- 13
- ADO >> Use OleDB DB2 provider type without extra software?I recently realized that I need IBM's iSeries Access installed to use
Provider=IBMDA400.DataSource.1 in an OleDB connection string.
Is there any .NET 2.0 class or dll that provides DB2 data access
without any other software installs besides the .NET 2.0 Framework? Or,
alternatively, can I pack whichever specific class/dll provides
IBMDA400.DataSource.1 into the project itself (and not as a reference
to it externally)?
- 14
- 15
- Net Framework >> Class not registeredHi Every one,
I am developing web application using c# in Visual Studio 2005 Beta 1. When
I try to connect my SQL database, I am getting error
"System.Data.OleDb.OleDbException: Class not registered". My database is in
Sql Server 2000. I am using OLEDB namespace. For some specific business need
I am using oledb namespace instead of sql name space of system.data. Can any
body help me in resolving this.
Thanks in advance.
Shailesh.
|
| Author |
Message |
pieta4mi

|
Posted: Tue Mar 21 15:43:21 CST 2006 |
Top |
ADO >> Getting Data from a DataSet
Hello,
I have a DataSet that was returned from a QueryMethod ( ).
Using the following code, I drilled down to the column level but am unsure
how to get at the data:
Dim ds As System.Data.DataSet
Dim dt As System.Data.DataTable
Dim dr As System.Data.DataRow
Dim dc As System.Data.DataColumn
ds = QueryMethod()
For Each dt In ds.Tables
For Each dr In dt.Rows
For Each dc In dt.Columns
if dr(dc) = "owner" then
' GET DATA VALUE IN THE TABLE IN THE ROW OF THE COLUMN
end if
Next dc
Next dr
Next dt
Thanks for any help.
glenn
DotNet132
|
| |
|
| |
 |
William

|
Posted: Tue Mar 21 15:43:21 CST 2006 |
Top |
ADO >> Getting Data from a DataSet
Ah Glenn, there are million examples of this on the web and in any (growing)
number of books on ADO.NET
once you have the ds:
dim x as Object
x = ds.Tables("Mytable").Rows(0).Item("MyColumnName")
While this will do the trick, it's not (at all) efficient as many have
pointed out. I suggest doing some reading. My book might be a good place to
start...
--
William (Bill) Vaughn
President and Founder Beta V Corporation
Redmond, WA
(425) 556-9205
Microsoft MVP, Author, Mentor
Microsoft MVP
"glenn" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Hello,
>
> I have a DataSet that was returned from a QueryMethod ( ).
>
> Using the following code, I drilled down to the column level but am unsure
> how to get at the data:
>
> Dim ds As System.Data.DataSet
> Dim dt As System.Data.DataTable
> Dim dr As System.Data.DataRow
> Dim dc As System.Data.DataColumn
>
> ds = QueryMethod()
>
> For Each dt In ds.Tables
> For Each dr In dt.Rows
> For Each dc In dt.Columns
> if dr(dc) = "owner" then
>
> ' GET DATA VALUE IN THE TABLE IN THE ROW OF THE
> COLUMN
>
> end if
> Next dc
> Next dr
> Next dt
>
> Thanks for any help.
> glenn
|
| |
|
| |
 |
glenn

|
Posted: Tue Mar 21 16:26:30 CST 2006 |
Top |
ADO >> Getting Data from a DataSet
and what book name might that be?
"William (Bill) Vaughn" wrote:
> Ah Glenn, there are million examples of this on the web and in any (growing)
> number of books on ADO.NET
> once you have the ds:
> dim x as Object
> x = ds.Tables("Mytable").Rows(0).Item("MyColumnName")
> While this will do the trick, it's not (at all) efficient as many have
> pointed out. I suggest doing some reading. My book might be a good place to
> start...
>
> --
> William (Bill) Vaughn
> President and Founder Beta V Corporation
> Redmond, WA
> (425) 556-9205
> Microsoft MVP, Author, Mentor
> Microsoft MVP
> "glenn" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > Hello,
> >
> > I have a DataSet that was returned from a QueryMethod ( ).
> >
> > Using the following code, I drilled down to the column level but am unsure
> > how to get at the data:
> >
> > Dim ds As System.Data.DataSet
> > Dim dt As System.Data.DataTable
> > Dim dr As System.Data.DataRow
> > Dim dc As System.Data.DataColumn
> >
> > ds = QueryMethod()
> >
> > For Each dt In ds.Tables
> > For Each dr In dt.Rows
> > For Each dc In dt.Columns
> > if dr(dc) = "owner" then
> >
> > ' GET DATA VALUE IN THE TABLE IN THE ROW OF THE
> > COLUMN
> >
> > end if
> > Next dc
> > Next dr
> > Next dt
> >
> > Thanks for any help.
> > glenn
>
>
>
|
| |
|
| |
 |
William

|
Posted: Thu Mar 23 15:28:57 CST 2006 |
Top |
ADO >> Getting Data from a DataSet
See www.betav.com for a complete list. I was referring to either the latest
Hitchhiker's Guide or the "ADO and ADO.NET Examples..." titles. I'm working
on a new version of the HHG for the 2005 products. It should be ready in a
few months.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"glenn" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> and what book name might that be?
>
> "William (Bill) Vaughn" wrote:
>
>> Ah Glenn, there are million examples of this on the web and in any
>> (growing)
>> number of books on ADO.NET
>> once you have the ds:
>> dim x as Object
>> x = ds.Tables("Mytable").Rows(0).Item("MyColumnName")
>> While this will do the trick, it's not (at all) efficient as many have
>> pointed out. I suggest doing some reading. My book might be a good place
>> to
>> start...
>>
>> --
>> William (Bill) Vaughn
>> President and Founder Beta V Corporation
>> Redmond, WA
>> (425) 556-9205
>> Microsoft MVP, Author, Mentor
>> Microsoft MVP
>> "glenn" <EMail@HideDomain.com> wrote in message
>> news:EMail@HideDomain.com...
>> > Hello,
>> >
>> > I have a DataSet that was returned from a QueryMethod ( ).
>> >
>> > Using the following code, I drilled down to the column level but am
>> > unsure
>> > how to get at the data:
>> >
>> > Dim ds As System.Data.DataSet
>> > Dim dt As System.Data.DataTable
>> > Dim dr As System.Data.DataRow
>> > Dim dc As System.Data.DataColumn
>> >
>> > ds = QueryMethod()
>> >
>> > For Each dt In ds.Tables
>> > For Each dr In dt.Rows
>> > For Each dc In dt.Columns
>> > if dr(dc) = "owner" then
>> >
>> > ' GET DATA VALUE IN THE TABLE IN THE ROW OF THE
>> > COLUMN
>> >
>> > end if
>> > Next dc
>> > Next dr
>> > Next dt
>> >
>> > Thanks for any help.
>> > glenn
>>
>>
>>
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ ADO |
- Next
- 1
- 2
- Visual C#.Net >> Please Help!!!I have a problem.
I use the code below and sometimes appear errors when I'm scrolling fast the
myDBGridCL1 (a DataGrid), what it could be?
And this.data.Rows.InsertAt(rowt,0); works not properly, it just adds at
end not ahead.
System.Data.DataTable data=new System.Data.DataTable("Table");
....
myDBGridCL1.DataSource=data;
.....
this.data.Rows.InsertAt(rowt,0);
....
this.data.Rows.RemoveAt(countrowst-1);
this.data.AcceptChanges();
- 3
- 4
- Net Framework >> Restart with ClickOnceIs it possible to require a reboot with a clickonce deployment - IE:
show a window that says: You need to reboot your computer (or similar)
with buttons: "reboot now" and "reboot later" or similar, after
installing?
- 5
- Net Framework >> how can i manipulate a check box in another processi want to manipulate a check box in another process,how can i get it
the check box in the process A,developed by C#
now i want to manipulate the check box in other application developed by MFC
as the usually,i sendmessage BM_SETCHECK from the MFC application to the checkbox of a C#
application,but it respond nothing
but i send message from MFC application to another MFC application ,it work right
what can i do
thanks very much.
- 6
- Visual C#.Net >> Equals and "==" operatorHi,
What is the difference between Object.Equals and "==" operator ?
When we use CollectionBase.List.Remove(object), which methods is used to
compare objects ?
Thanks
- 7
- ADO >> Dataset code...is this correct?ok, I am trying to make one call to the db and create a datalist and then
populate a datalist and a datagrid with different filtered versions of the
dataset. I presume this is a better way of doing it than making two seperate
calls to the db where I could just use 2 stored procs to filter the data.
Any help or advice if I'm doing it the wrong way would be appreciated.
' Obtain Link information from Links table
Dim links As New DNSite.LinksDB()
Dim myDS As DataSet
myDS = links.GetLinks(CatID)
' filter dataset for premier links
' and bind to the datalist control
plusdl.DataSource = myDS.Tables("tblLinks").Select("TypeName = Premier
Plus")
plusdl.DataBind()
' bind remaining links to DataGrid
premierDG.DataSource = myDS.Tables("tblLinks").Select("TypeName <> Premier
Plus")
premierDG.DataBind()
-----------------------------------
I get the following error:
-----------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Source Error:
Line 88: ' and bind to the datalist control
Line 89:
Line 90: plusdl.DataSource =
myDS.Tables("tblLinks").Select("TypeName = Premier")
Line 91: plusdl.DataBind()
Source File: **********\DNSLinks.ascx.vb Line: 90
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
ASPNetPortal.DNSLinks.BindGrid() in ********\DNSLinks.ascx.vb:90
ASPNetPortal.DNSLinks.Page_Load(Object sender, EventArgs e) in
********\DNSLinks.ascx.vb:76
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Control.LoadRecursive() +92
System.Web.UI.Control.LoadRecursive() +92
System.Web.UI.Control.LoadRecursive() +92
System.Web.UI.Page.ProcessRequestMain() +724
- 8
- Dotnet >> Detect SubformsI have a main form that can launch several subforms.
Both the main form remains active when the subform is visible.
I want to prevent the user from launching multiple copies of the subform.
How can I do this?
Here's my code for launching one of the subforms:
frmMove Move = new frmMove(this,
treeView1.SelectedNode);
Move.Show();
Move.Activate();
Move.TopMost=true;
- 9
- Visual C#.Net >> C# vs Java SerializationHello,
I have two Java applications that exchange serialized
objects. Although I would like to ultimately convert both
to C# it's a pretty monumental task, especially for
someone just learning both langauges. I thought it might
be more reasonable to start with simply converting the
simpler one of the two and getting it to work. I have
used Microsoft's free Java to C# converter to convert most
of the code, but of course I must complete some of the
conversions manually. I have this basic concern,
however: Will the serialization done in C# be the same as
that done in Java? Also, do all Java compilers serialize
the same way for the same source code? How do I determine
exactly what the serialized data looks like, both
theoretically and emperically? I'd like to be able to
view it at the byte level just for general debugging
purposes. (Of course I could use a packet sniffer, but
that's a little too gross even for a hardware person like
me!)
Thanks,
Ray Mitchell
- 10
- Dotnet >> XML->Dataset->DatabaseI am developing a type of data warehouse. Basically, we have 20 client survey
machines that are each separated from the server by space and lack of
network. Yet both need to speak to each other such that the clients know the
latest configuration information and the server contains completed survey
data from the clients. Currently I'm accomplishing this by using a few
special database tables to control the flow of information, and using XML
serialized datasets on both ends and a USB drive to move them back and forth.
The design seems to work.
However, some of these tables have 50+ columns and creating manual insert
statements has gotten absurd. For example, on the server I generate a dataset
based on what needs to be sent to the client, it works fine. I then read in
that XML into a dataset on the client. So now, how do I best get that data
into the SQL database on the client side? The only way I've found to do it is
to create a DataAdapter and insert each row at a time, after setting up all
the commands, parameters, and filling out each row. This is absurd, it winds
up being hundreds of lines. I really want something like this:
Dataset ds;
ds.connection = my connection;
ds.update();
After all, the schema is exactly the same on both ends! So, I don't really
expect the above, but there has to be an easier way than reinventing the
wheel. Basically, I have a dataset full of data that matches the database I
want to get it inside, only it wasn't taken from that database so it's not
just a simple sqladapter.update() call.
Any ideas? Thanks in advance.
- 11
- Winforms >> Why events are behaving differently for controls in 1.0 and 1.1 of .NET?Hi all,
I have observed that some of the controls in 1.0 .NET framework behave
differently in 1.1 .NET framework.
For example - the ComboBox control:
The combo box is in DropDown mode. Consider the behavior of KeyPress event.
In 1.0 framework, the combobox Text property contains the modified value
during KeyPress event handling.
For eample, if the text in the combobox is "test" initially and I modified
it to "test1" then in key press event the Text property is "test1".
But this is not the case in 1.1 framework. The Text property is old value
i,e., in this case "test" but not "test1".
private void testComboBox_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
System.Diagnostics.Debug.WriteLine("Text Value in KeyPress :" +
testComboBox.Text);
}
run this in both 1.0 and 1.1 framework.
Due to this my applications are not working properly when I port them from
1.0 to 1.1 .NET framework.
My main concern is: Is this behavior is a bug or intentionally done ?
Because this is causing problems: Help!!!!
Thanks,
Anil.
- 12
- Microsoft Project >> Changing resource units and levellingI want to change the resource units assigned on the
resource sheet i.e. reduce from 100% to 50%.
Then reflect this change in the tasks on the plan. Tasks
are set to fixed unit and I'd expect the maximum
allocation for the resource to change to 50% and the
duration of the task to extend.
Currently the duration stays the same and levelling
returns errors.
Is there a quick way to update tasks to reflect the
change resource availability?
- 13
- Dotnet >> Subclassing the PropertyGridFolks -
I've done some searching on the 'net, and I think I know the answer to my
question, but I wanted to pose it anyway, just in case.
I'm embarking on a new project, and we're investigating the use of the
PropertyGrid. I've used it in a couple of places before, but never in an
application that goes out to my general user base. We really like the
functionality and capabilities it provides, but some of the display choices
are not exactly what we want.
Some initial tests of creating an inherited control (and my above-mentioned
searching) seemed to show that I'm SOL if I want to override the drawing of
the control elements. I really do not want to go through the effort of
re-creating the majority of this control just so we can draw a couple of
things differently.
Any ideas?
TIA
- Scott
- 14
- Net Framework >> Framework 2.0 not showing up in IISWindows Server 2003, all sp's.
Installed Framework 2.0 on this box, and it says that it installed, but
the tab for ASP.NET on the properties doesn't show up. We've removed &
reinstalled, but that hasn't helped.
Does anyone have any ideas as to what's happening to this?
The only option I can think of that we already have not tried is to just
uninstall Framework & then IIS then reinstall both of them.
Help!!
BC
- 15
- Winforms >> Delegates & EventsI need some clarrification.
I have a class called ChatManager that will manage the interaction between
the ClientUI (WinForm) and the chat server.
The ChatManager will have a number of public events.
When the ClientUI is instantiated it will subscribe to these events
providing its own methods to be used as event handlers.
In the ChatManager code when I raise a particular event...which in turn
calls the delegate...
Will the delegate execute on the same thread as the ClientUI (which it must
do to update the WinForm) or does it execute on some other thread?
Kyle!
|
|
|