Showing posts with label records. Show all posts
Showing posts with label records. Show all posts

Thursday, March 22, 2012

dataset query based on a global parameter

I need to create a report that displays data based on the userid. all the
records have a userid field filled with many userid values. how can I use the
global paramerer userid in the criteria for my dataset. so when a user run
the report olny records with his or her userid are showncreate a parameter with default value the global parameter. then use that
parameter in the query. ofcourse you can't use caching for those reports
"DJJIII" wrote:
> I need to create a report that displays data based on the userid. all the
> records have a userid field filled with many userid values. how can I use the
> global paramerer userid in the criteria for my dataset. so when a user run
> the report olny records with his or her userid are shown|||You do not have to have a 1:1 mapping between query parameters and report
parameters. Doing it the way suggested here means you have to muck around
with hiding it (since you don't want people to change it).
Have your query parameter, let's call it @.UserID. RS will automatically
recreate a report parameter called UserID but we won't use it. Click on the
..., go to parameters. Map the query parameter @.UserID to the global . The
parameter dialog box has a name and value columns. On the value side switch
it to expression. This brings you to the expression builder where you can
pick the User!UserID global variable. One thing to note, this variable has
the domain as well as the user id, so if you don't want this you will have
to strip it off.
Now, go you your layout, Report->Parameters and delete the now unneeded
UserID report parameter.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Antoon" <Antoon@.discussions.microsoft.com> wrote in message
news:04C477F1-17E5-47C5-BB11-9EF31278F1CE@.microsoft.com...
> create a parameter with default value the global parameter. then use that
> parameter in the query. ofcourse you can't use caching for those reports
> "DJJIII" wrote:
>> I need to create a report that displays data based on the userid. all
>> the
>> records have a userid field filled with many userid values. how can I use
>> the
>> global paramerer userid in the criteria for my dataset. so when a user
>> run
>> the report olny records with his or her userid are shown|||great tip, that is indeed a lot more practical
"Bruce L-C [MVP]" wrote:
> You do not have to have a 1:1 mapping between query parameters and report
> parameters. Doing it the way suggested here means you have to muck around
> with hiding it (since you don't want people to change it).
> Have your query parameter, let's call it @.UserID. RS will automatically
> recreate a report parameter called UserID but we won't use it. Click on the
> ..., go to parameters. Map the query parameter @.UserID to the global . The
> parameter dialog box has a name and value columns. On the value side switch
> it to expression. This brings you to the expression builder where you can
> pick the User!UserID global variable. One thing to note, this variable has
> the domain as well as the user id, so if you don't want this you will have
> to strip it off.
> Now, go you your layout, Report->Parameters and delete the now unneeded
> UserID report parameter.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Antoon" <Antoon@.discussions.microsoft.com> wrote in message
> news:04C477F1-17E5-47C5-BB11-9EF31278F1CE@.microsoft.com...
> > create a parameter with default value the global parameter. then use that
> > parameter in the query. ofcourse you can't use caching for those reports
> >
> > "DJJIII" wrote:
> >
> >> I need to create a report that displays data based on the userid. all
> >> the
> >> records have a userid field filled with many userid values. how can I use
> >> the
> >> global paramerer userid in the criteria for my dataset. so when a user
> >> run
> >> the report olny records with his or her userid are shown
>
>

Wednesday, March 21, 2012

DataSet Filter

I have one dataset that contains thousands of records i want to filter the dataset by one of the name

select col1,col2,col3 from tablename

this col1 contains various names i want to check wheather an name exists in the col1 or not

please guide me

Hi, Febin

For your problem there is two possible solutions, First one is RowFilter and second one is Select

Solution 1 (RowFilter)

Dim ds As New Data.DataSet

Dim CN As New SqlClient.SqlConnection(MyClass1.ConnStr)

Dim Stmt As String

Stmt = "select * from USER_MASTER"

Dim DA As New SqlClient.SqlDataAdapter(stmt, CN)

DA.Fill(ds, "USER_MASTER")

ds.Tables("USER_MASTER").DefaultView.RowFilter = "DEPT ='ADMIN'"

MsgBox(ds.Tables("USER_MASTER").DefaultView.Count)

Solution 2 (Select)

Dim ds As New Data.DataSet

Dim CN As New SqlClient.SqlConnection(MyClass1.ConnStr)

Dim Stmt As String

Stmt = "select * from USER_MASTER"

Dim DA As New SqlClient.SqlDataAdapter(stmt, CN)

DA.Fill(ds, "USER_MASTER")

Dim R() As DataRow

R = ds.Tables("USER_MASTER").Select("DEPT ='ADMIN'", "EMP_NAME")

If R.Length > 0 Then

MsgBox(R.Length & " Record(s) Found")

End If

In the sample code it shows the number of records found for dept called "ADMIN",

Happy Coding

sql

Dataset blues

i don't know if this is the right forum for this question but here goes. I have created a gridview to display a list of records retrieved by a SQL query. Everytime I run it, I get the following error:

Object must implement IConvertible.

I thought it might have to do with the data I'm passing in the session string from the previous page. Here is that code:

ProtectedSub cmdSubmit_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles cmdSubmit.Click

Session.Add("Shift", shShift.SelectedItem)

Session.Add("Type", shType.SelectedItem)

Session.Add("SelDate", OccDate.SelectedDate)

Response.Redirect("SelectIncRep.aspx")

Here is the code that is supposed to execute and display the data on page_init:

<asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="False"DataKeyNames="RID"DataSourceID="SqlDataSource1"Width="1215px"BorderStyle="Groove"BorderWidth="4px">

<Columns>

<asp:BoundFieldDataField="RID"HeaderText="Record ID:"InsertVisible="False"ReadOnly="True"

SortExpression="RID"/>

<asp:BoundFieldDataField="Date"HeaderText="Date:"SortExpression="Date"/>

<asp:BoundFieldDataField="Shift_ID"HeaderText="Shift:"SortExpression="Shift_ID"/>

<asp:BoundFieldDataField="Xref_ID"HeaderText="Type Of Occurence:"SortExpression="Xref_ID"/>

<asp:BoundFieldDataField="Notes"HeaderText="Notes:"SortExpression="Notes"/>

</Columns>

</asp:GridView>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:PerfDataConnectionString %>"

SelectCommand="SELECT [RID], [Notes], [Date], [Shift_ID], [Xref_ID] FROM [Safety_data] WHERE (([Shift_ID] = @.Shift_ID) AND ([Xref_ID] = @.Xref_ID) AND ([Date] = @.Date))">

<SelectParameters>

<asp:SessionParameterName="Shift_ID"SessionField="Shift_ID"Type="Int32"/>

<asp:SessionParameterName="Xref_ID"SessionField="Type"Type="Int32"/>

<asp:SessionParameterName="Date"SessionField="Date"Type="DateTime"/>

</SelectParameters>

</asp:SqlDataSource>

What could be causing the issue?

BezerkRogue:

Session.Add("Shift", shShift.SelectedItem)
Session.Add("Type", shType.SelectedItem)
Session.Add("SelDate", OccDate.SelectedDate)

.....

<asp:SessionParameterName="Shift_ID"SessionField="Shift_ID"Type="Int32"/>
<asp:SessionParameterName="Xref_ID"SessionField="Type"Type="Int32"/>
<asp:SessionParameterName="Date"SessionField="Date"Type="DateTime"/>

|||

Thanks. I made that correction but still get the same error. I dumped my temporary internet files to make sure I wasn't loading cached data. Could there be anything else I might have missed?

|||

Did you already googled this error?

I found some results that all pointed in the same direction, which seams to be the case here also. You omitted the select type, so maybe this is the solution?

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:PerfDataConnectionString %>"

SelectCommand="SELECT [RID], [Notes], [Date], [Shift_ID], [Xref_ID] FROM [Safety_data] WHERE (([Shift_ID] = @.Shift_ID) AND ([Xref_ID] = @.Xref_ID) AND ([Date] = @.Date))"SelectType="Text">

|||

I added the selectcommandtype line in and still get the same error. The stack trace is chinese to me so I have no idea what the problem is.

Object must implement IConvertible.

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.InvalidCastException: Object must implement IConvertible.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[InvalidCastException: Object must implement IConvertible.] System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +2514354 System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +264 System.Web.UI.WebControls.Parameter.get_ParameterValue() +66 System.Web.UI.WebControls.ParameterCollection.GetValues(HttpContext context, Control control) +254 System.Web.UI.WebControls.SqlDataSourceView.InitializeParameters(DbCommand command, ParameterCollection parameters, IDictionary exclusionList) +276 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +754 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360



Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

|||

Ok, I found the variable that is being passed wrong and corrected it. I have verified that I am getting variables passed and have printed them on screen. I have also verified that I have records available for those variables, now I just get no data. Am I missing a binding somewhere?

<asp:gridviewrunat="server"ID="RecordView"AutoGenerateColumns="False"DataKeyNames="RID"DataSourceID="SqlDataSource1"Width="1134px"GridLines="Both"EnableViewState="true"Visible="true">

<Columns>

<asp:BoundFieldDataField="RID"HeaderText="RID"Visible="true"ReadOnly="True"

SortExpression="RID"/>

<asp:BoundFieldDataField="Notes"HeaderText="Notes"Visible="true"SortExpression="Notes"/>

</Columns>

</asp:gridview>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:PerfDataConnectionString %>"

SelectCommand="SELECT [RID], [Notes] FROM [Safety_data] WHERE (([Date] = @.Date) AND ([Shift_ID] = @.Shift_ID) AND ([Xref_ID] = @.Xref_ID))"SelectCommandType="Text">

<SelectParameters>

<asp:QueryStringParameterName="Date"QueryStringField="strSelDate"Type="DateTime"/>

<asp:QueryStringParameterName="Shift_ID"QueryStringField="strShiftPull"Type="Decimal"/>

<asp:QueryStringParameterName="Xref_ID"QueryStringField="strTypePull"Type="Decimal"/>

</SelectParameters>

</asp:SqlDataSource>

Sunday, March 11, 2012

DataGridView/SQL Express - Updating record using seperate form

Hi,

I am currently using VC++/Cli 2005. In a project, I'm using a DataGridView control to show records from a SQL Express 2005 table. Instead of updating a specific item directly within DataGridView control, I would like to open a new form and allow user to update selected record/item within that form. The reason to update this way is conditionned by the fact that I have 3 levels of detail as following:

Level 0 Level 1 Level 2

1:N 1:N
Furniture --> Component --> Component

You all understand that update form of Level1 will/must include, as Level0 do, another DataGridView control to display/detail all related items issued from next level. This explains why I can't allow user to update Level 1 directly from DataGridView control.

I've searched in MSDN and even bought a few books on subject but unfortunately I found nothing on how to do it this way. All articles on DataGridView control were only showing how to update record directly from control.

My approach, I think, would be to transmit to my level1 updating form, as a single parameter, the selected DataRow object (or a brand new one if currently adding) issued from DataGridView and let user update it's content. When User finally leaves level0 update form, then I presume that DataGridView corresponding table would be automatically updated according to DataGridView's content.

What would be the proper way to do it? I would certainly appreciate to hear you view on this.

Also, what can I do if I want to refresh DataGridView's content when coming back from update form. Is it done automatically? I would certainly be sure that it reflects the reality, not only when I update it myself but also especially when other users could concurrently update same records?

Thanks in advance,

Stphane

Hi Stephane,

It sounds like you're looking for a Master/Detail implementation. There are a number of topics covering this in MSDN, start with the first three hits on this search.

Mike

|||

Hi Mike,

I followed links supplied. For what I could see, they are only showing how to put 2 DataGridView controls, master and detail, on same windows form and have data displayed accordingly. I already had a look at this technique. Unfortunately, this is not exactly what I'm looking for.

I'm definitely looking to be able to get/highlight a record (a row...) from a DataGridView control and then be able to perform any insert/update/delete operation, update its content using a new windows form which will be my "updating" form where user will be able to supply any required infos for that specific record/row instead of doing it directly from within DataGridView control.

Any hint or useful links?

Thanks again for your help,

Stphane

|||

Hi Stephane,

First off, remember this is the SQL Express forum and you're asking about a VS component so you might get a better answer in one of the VS forums. I'd suggest the .NET Data Access forum as a place to start, but language specific forums or Windows Forms forums may also be usefull.

That said, if you start with this topic about using two DataGridViews but split the two DGs between two forms, it should just be a matter of writing some code to react to an action on the Master form. Check out the documentation for this control, there are a number of Properties that allow you to determin the selection as well as some events (i.e. OnClick) that should let you respond to user action in the control.

I'm guessing that if you ask around in the VS forums someone will have already written a framework to do this.

Mike

|||

Hi Mike,

Thanks for clarification. I must admit that I get quite lost when trying to find appropriate forum... Any document or article listing all forums and their purposes? Would certainly help!

I followed your link but anything I can find on MSDN is an example using 2 datagridviews on same form. For my case, I just try to find a way to, first, select a SQL table record from datagridview in form1, open a new form, form2, where I will enable user to update record's content. Scenario I illustrated could also include a second datagridview in form2.

Now browsing through the many forums available, it seems that there is one discussing specific issues regarding datagridview:

MSDN Forums Windows Forms Windows Forms Data Controls and Databinding

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Hope I will be able to get any hint from there!

Thanks for your help,

Stphane

|||

Hi Stephanie,

You might be confused because many of the VS examples and Walkthroughs, including this one, do not walk you through using the VS UI to create the example, they use a 100% code based solution. The sample that I linked to provides code that programatically creates a form with two DataGridViews on it, attaches those DGVs to BindingSources and then hooks them up to the Northwind Database.

VS doesn't have many help topics that walk through specific tasks using the UI tools. I looked around on http://windowsforms.com and didn't really find anything that discusses how to use the UI to do this either, but you're welcome to take a look yourself as you may find some interesting material there.

There isn't a document listing all the fourms, but this page has them all. Each has a short description which hopefully describes it's use.

Mike

|||

Hi again Mike,

Thanks for links. I will keep looking around. I got my hand on a book which seems to give some hints about DGVs. Hope I will find something...

Stphane

DataGridView/SQL Express - Updating record using seperate form

Hi,

I am currently using VC++/Cli 2005. In a project, I'm using a DataGridView control to show records from a SQL Express 2005 table. Instead of updating a specific item directly within DataGridView control, I would like to open a new form and allow user to update selected record/item within that form. The reason to update this way is conditionned by the fact that I have 3 levels of detail as following:

Level 0 Level 1 Level 2

1:N 1:N
Furniture --> Component --> Component

You all understand that update form of Level1 will/must include, as Level0 do, another DataGridView control to display/detail all related items issued from next level. This explains why I can't allow user to update Level 1 directly from DataGridView control.

I've searched in MSDN and even bought a few books on subject but unfortunately I found nothing on how to do it this way. All articles on DataGridView control were only showing how to update record directly from control.

My approach, I think, would be to transmit to my level1 updating form, as a single parameter, the selected DataRow object (or a brand new one if currently adding) issued from DataGridView and let user update it's content. When User finally leaves level0 update form, then I presume that DataGridView corresponding table would be automatically updated according to DataGridView's content.

What would be the proper way to do it? I would certainly appreciate to hear you view on this.

Also, what can I do if I want to refresh DataGridView's content when coming back from update form. Is it done automatically? I would certainly be sure that it reflects the reality, not only when I update it myself but also especially when other users could concurrently update same records?

Thanks in advance,

Stphane

Hi Stephane,

It sounds like you're looking for a Master/Detail implementation. There are a number of topics covering this in MSDN, start with the first three hits on this search.

Mike

|||

Hi Mike,

I followed links supplied. For what I could see, they are only showing how to put 2 DataGridView controls, master and detail, on same windows form and have data displayed accordingly. I already had a look at this technique. Unfortunately, this is not exactly what I'm looking for.

I'm definitely looking to be able to get/highlight a record (a row...) from a DataGridView control and then be able to perform any insert/update/delete operation, update its content using a new windows form which will be my "updating" form where user will be able to supply any required infos for that specific record/row instead of doing it directly from within DataGridView control.

Any hint or useful links?

Thanks again for your help,

Stphane

|||

Hi Stephane,

First off, remember this is the SQL Express forum and you're asking about a VS component so you might get a better answer in one of the VS forums. I'd suggest the .NET Data Access forum as a place to start, but language specific forums or Windows Forms forums may also be usefull.

That said, if you start with this topic about using two DataGridViews but split the two DGs between two forms, it should just be a matter of writing some code to react to an action on the Master form. Check out the documentation for this control, there are a number of Properties that allow you to determin the selection as well as some events (i.e. OnClick) that should let you respond to user action in the control.

I'm guessing that if you ask around in the VS forums someone will have already written a framework to do this.

Mike

|||

Hi Mike,

Thanks for clarification. I must admit that I get quite lost when trying to find appropriate forum... Any document or article listing all forums and their purposes? Would certainly help!

I followed your link but anything I can find on MSDN is an example using 2 datagridviews on same form. For my case, I just try to find a way to, first, select a SQL table record from datagridview in form1, open a new form, form2, where I will enable user to update record's content. Scenario I illustrated could also include a second datagridview in form2.

Now browsing through the many forums available, it seems that there is one discussing specific issues regarding datagridview:

MSDN Forums Windows Forms Windows Forms Data Controls and Databinding

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Hope I will be able to get any hint from there!

Thanks for your help,

Stphane

|||

Hi Stephanie,

You might be confused because many of the VS examples and Walkthroughs, including this one, do not walk you through using the VS UI to create the example, they use a 100% code based solution. The sample that I linked to provides code that programatically creates a form with two DataGridViews on it, attaches those DGVs to BindingSources and then hooks them up to the Northwind Database.

VS doesn't have many help topics that walk through specific tasks using the UI tools. I looked around on http://windowsforms.com and didn't really find anything that discusses how to use the UI to do this either, but you're welcome to take a look yourself as you may find some interesting material there.

There isn't a document listing all the fourms, but this page has them all. Each has a short description which hopefully describes it's use.

Mike

|||

Hi again Mike,

Thanks for links. I will keep looking around. I got my hand on a book which seems to give some hints about DGVs. Hope I will find something...

Stphane

Thursday, March 8, 2012

Dataflow slows dramatically down after passing 1.6 million records ?

If i have a dataflow witch moves records from one OLE DB Source to a OLE DB Destination, the step slow down when getting above passing 1.5 - 1.6 million records.The Source is a SQL 2000 and the Destination is SQL Server 2005. the Package is run from a laptop with 1.5 GB ram

What can i try to help it ?Check the perf counters to see if the package starts swapping when the slowdown occurs. If this is the case then there is not much to be done. You could try adding more memory or making the destination run faster (i.e. drop indicies, faster spindle, etc). Is the destination on the same PC as the package is running? If so then they are competing for memory so you could run the package on a different PC. Also, the next CTP has a minor change that you may find helps with this.

Thanks,|||Start by checking in Task Manager how much memory the package (i.e. dtexec.exe) uses - does it grow all the time?
And when it slows down, are you out of memory + swapping starts + CPU usage goes down?
If this is the case - do you expect memory usage to grow like this, given your data flow? Which component could be gobbling up the memory? Can you change its settings to improve the situation? Or change the data flow to not use the troublesome component?
Or is there a memory leak that creates a problem?
If the bottleneck isn't memory at all, you obviously have to look in other places...

Cheers,
KDog|||

Matt David wrote:

Check the perf counters to see if the package starts swapping when the slowdown occurs.

How do you check the perf counters?
Regards,
Henk|||Use the Windows Performance Monitor (Administrative Tools-->Performance). In there, there is an IS object containing various counters that you can use to monitor performance.

There is a help file provided that explains how to use Windows Performance Monitor.

-Jamie

Wednesday, March 7, 2012

Data-driven Subscription e-mail problem

Trying to test a data-driving subscription for 5 records for a specific
report. Run report interactively successfully in report services. Can't
figure out why e-mail is not being sent (set my e-mail address for all 5).
Status showing "Done: 5 processed of 5; 5 errors". Verified SMTPServer info
set correctly in rsReportServer Config file. Viewed the
ReportServer(date).log file and no information listed, checked windows
application log and report server is being activated successfully. Any
suggestions' Thanks. JanineAre you running RS on a Windows Server 2003? If so, I think that there is a
known issue that can be solved with a hotfix. We had a similar problem and it
wasn't the RS configuration that was causing the problem rather it was an
issue with Windows Server 2003. Sorry that I do not have any additional info.
"JanineB1129" wrote:
> Trying to test a data-driving subscription for 5 records for a specific
> report. Run report interactively successfully in report services. Can't
> figure out why e-mail is not being sent (set my e-mail address for all 5).
> Status showing "Done: 5 processed of 5; 5 errors". Verified SMTPServer info
> set correctly in rsReportServer Config file. Viewed the
> ReportServer(date).log file and no information listed, checked windows
> application log and report server is being activated successfully. Any
> suggestions' Thanks. Janine|||Do regular subscriptions work?
You need to look in the reportserverservice<date>.log file for the errors.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"B. Mark McKinney" <BMarkMcKinney@.discussions.microsoft.com> wrote in
message news:02470CE4-B6B0-48E5-B387-BF0691124515@.microsoft.com...
> Are you running RS on a Windows Server 2003? If so, I think that there is
a
> known issue that can be solved with a hotfix. We had a similar problem and
it
> wasn't the RS configuration that was causing the problem rather it was an
> issue with Windows Server 2003. Sorry that I do not have any additional
info.
> "JanineB1129" wrote:
> > Trying to test a data-driving subscription for 5 records for a specific
> > report. Run report interactively successfully in report services. Can't
> > figure out why e-mail is not being sent (set my e-mail address for all
5).
> > Status showing "Done: 5 processed of 5; 5 errors". Verified SMTPServer
info
> > set correctly in rsReportServer Config file. Viewed the
> > ReportServer(date).log file and no information listed, checked windows
> > application log and report server is being activated successfully. Any
> > suggestions' Thanks. Janine

Sunday, February 26, 2012

Databinding in c# - Important

Hello
All the samples I found are based on datagrid for the child table.
What if I don't want the child records to be displayed in a datagrid, but in
their own data bound controls like "text box, combo & list boxes). And I
want to provide a second level of navigation buttons to traverse those child
records in the child table.
I'm sure this is possible, but I can't seem to find any sample on it.
Please let me know if you can throw any light on it.
Thank You
You can use the BindingContext and the BindingManagerBase classes to
accomplish this... using the Control.DataBindings.Add( , , )
I don't have any sample off of the top of my head but if you put in
BindingContext and BindingManagerBase in google, you'll find some
W.G. Ryan, MVP
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Hemang Shah" <hemang@.hemang.net> wrote in message
news:ToidnScZwb7iqGjcRVn-ow@.rogers.com...
> Hello
> All the samples I found are based on datagrid for the child table.
> What if I don't want the child records to be displayed in a datagrid, but
in
> their own data bound controls like "text box, combo & list boxes). And I
> want to provide a second level of navigation buttons to traverse those
child
> records in the child table.
> I'm sure this is possible, but I can't seem to find any sample on it.
> Please let me know if you can throw any light on it.
> Thank You
>
>
|||Hemang,
It's the same as if you were binding to the grid. When you add the
binding for the control to the child table, you set the data source to the
relation, not to the child table itself.
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]
- mvp@.spam.guard.caspershouse.com
"Hemang Shah" <hemang@.hemang.net> wrote in message
news:ToidnScZwb7iqGjcRVn-ow@.rogers.com...
> Hello
> All the samples I found are based on datagrid for the child table.
> What if I don't want the child records to be displayed in a datagrid, but
> in
> their own data bound controls like "text box, combo & list boxes). And I
> want to provide a second level of navigation buttons to traverse those
> child
> records in the child table.
> I'm sure this is possible, but I can't seem to find any sample on it.
> Please let me know if you can throw any light on it.
> Thank You
>
>

Sunday, February 19, 2012

DataBase: Timeout Expired

Hi,

When I am trying to query a table which has got lakhs of records,

it said, Error:Timeout Expired . Timeout Expired prior to completion of operation or server is not responding.

Can anybody help me out

You can change/set the timeout property in the connection string. A more important question is, do you really need to show that many hundreds of thousands of records in the application? There are ways like paging that you can only bring in few hundred records at a time.|||

I dont want to display all these results nut, i need to query these many records to display some 100 records.

I have used Timeout in Connection String also.

Connection is fine.

But Query Execution is taking that much time.

Something similar to http://techielion.blogspot.com

Can you please explain that to me?


|||

If you only need 100 records you could do a SELECT TOP 100 ....

If its still taking too long, check your query. Do you have proper indexes on the columns that are in the WHERE condition? Are the indexes up to date? Is there too much fragmentation?

|||

Hi,

You also need to check the ConnectionTimeout and CommandTimeout property to see if it is too small to return all the results.

Database/Table File Sizes

I would like to get some stats out of a database Mainly I would like to get
the no records in each table and if possible the size of each table, not
sure if the latter is possible?
Thanks
DerrickDerrick,
Try using "dbcc checktable"
eg:
use db_audit
go
dbcc checktable('tblaudit')
go
DBCC results for 'tblAudit'.
There are 126452 rows in 1305 pages for object 'tblAudit'.
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
Each page in SQL Server 2000 is 8kb. I'm not sure about other versions.
I'm fairly sure you can use "dbcc checkdb" to return information about
all of the tables in a database in a similar form.
I hope this helps,
Danny.
"Derrick King" <derrick.king@.bradford.gov.uk> wrote in message
news:belrgl$8hl$1@.newsreaderm1.core.theplanet.net...
> I would like to get some stats out of a database Mainly I would like to
get
> the no records in each table and if possible the size of each table, not
> sure if the latter is possible?
> Thanks
> Derrick
>|||> Each page in SQL Server 2000 is 8kb. I'm not sure about other versions.
> I'm fairly sure you can use "dbcc checkdb" to return information about
> all of the tables in a database in a similar form.
Yes, DBCC CHECKDB can also used. Also, DBCC CHECKDB should return accurate info. Note that
CHECKDB also does physical checking, so it might take a while.
One thing about my first suggestion: You might want to run DBCC UPDATEUSAGE using the COUNT_ROWS
parameter to update rowcount as well as space usage.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Daniel Johnson" <danny@.sysola.net> wrote in message news:belsc8$9h2$1@.titan.btinternet.com...
> Derrick,
> Try using "dbcc checktable"
> eg:
> use db_audit
> go
> dbcc checktable('tblaudit')
> go
> DBCC results for 'tblAudit'.
> There are 126452 rows in 1305 pages for object 'tblAudit'.
> DBCC execution completed. If DBCC printed error messages, contact your
> system administrator.
> Each page in SQL Server 2000 is 8kb. I'm not sure about other versions.
> I'm fairly sure you can use "dbcc checkdb" to return information about
> all of the tables in a database in a similar form.
> I hope this helps,
> Danny.
>
> "Derrick King" <derrick.king@.bradford.gov.uk> wrote in message
> news:belrgl$8hl$1@.newsreaderm1.core.theplanet.net...
> > I would like to get some stats out of a database Mainly I would like to
> get
> > the no records in each table and if possible the size of each table, not
> > sure if the latter is possible?
> >
> > Thanks
> >
> > Derrick
> >
> >
>