|
N a v a n e e t h wrote: You can use Select() method in the DataTable instance to select rows matching to the specified criteria.
How can I use select method for more than one tables?
We can use select method to filter just one table.If I have two tables and If I want to get relational data from these two tables,select method can not be useful.Am I right?
Thanks
please don't forget to vote on the post that helped you.
|
|
|
|
|
You are right. Select() can't be used across multiple tables. If all these tables belongs to one DataSet, I think you can use DataRelation to link it. I have not done that before, just a wild guess.
|
|
|
|
|
Currently I am doing this job this way.
I am passing Dataset to DistributeServices Method
Is there any better way?
private int MergeCount = 0;
private void DistributeServices(DataSet dsServiceRates)
{
DataTable dtFinal = new DataTable();
int CountTables = dsServiceRates.Tables.Count;
if (CountTables > 1)
{
for (int i = 0; i < CountTables; i++)
{
if (MergeCount == 0)
{
dtFinal = MergeService(dsServiceRates.Tables[i], dsServiceRates.Tables[i + 1]);
i++;
}
else
{
dtFinal = MergeService(dsServiceRates.Tables[i], dtFinal);
}
}
if (dtFinal.Rows.Count != 0)
{
}
else
{
}
}
else if (CountTables != 0)
{
}
else
{
}
}
private DataTable MergeService(DataTable dTable1, DataTable dTable2)
{
DataTable dtNew = new DataTable();
dtNew.Columns.Add("Method",System.Type.GetType("System.String"));
dtNew.Columns.Add("Rate", System.Type.GetType("System.String"));
foreach (DataRow dRow1 in dTable1.Rows)
{
foreach (DataRow dRow2 in dTable2.Rows)
{
if (dRow1["Method"].ToString() == dRow2["Method"].ToString())
{
MergeCount = 1;
AddRows(dtNew, dRow1["Method"].ToString(), decimal.Parse(dRow1["Rate"].ToString()) + decimal.Parse(dRow2["Rate"].ToString()));
}
}
}
return dtNew;
}
please don't forget to vote on the post that helped you.
|
|
|
|
|
string s = ",22,3,7,8,2,8,";
now I want to check
string has ,22, or not in starting only
,22, should be treated as a string not character.
please help me I need hardly any how
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
You can use StartsWith method of string.
string MyStr=",22,3,7,8,2,8,";
if(s.StartsWith(",22,"))
{
return true;
}
else
{
return false;
}
please don't forget to vote on the post that helped you.
|
|
|
|
|
thanks a lot
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Hi all,
Let me explain in detail what the problem actually is..
I have tried debugging the code starting from page_load, i can retrieve all the values under that event. I'm using a function called update_click which am calling that in listbar_click
Private Sub Update_Click()
Dim strSQL As String = ""
Dim ds As New DataSet
Dim intSlno As Integer
If Trim(txtCode.Value) = "" Then
lblStatus.Text = Item Code Empty"
Exit Sub
End If
end sub
In the above code i can access the value of all the variables but when i try to access the value of Trim(txtCode.Value)it says,
"Cannot evaluate expression because we are stopped in a place where garbage collection is impossible, since the code of the current method may be optimized."
I'm getting this problem only in this function... Can anyone please help me out..
|
|
|
|
|
Hi,
Private Sub Update_Click()
Dim strSQL As String = ""
Dim ds As New DataSet
Dim intSlno As Integer
If Trim(txtCode.Value) == "" Then
lblStatus.Text = Item Code Empty"
Exit Sub
End If
end sub
In the if condition u need to put == inseted of =. because this is condition and not an assignment.
Regards,
RAM
|
|
|
|
|
I dont think the == will work out without error in asp.net
|
|
|
|
|
Hi guys,
We have upgraded to vs2008 and .net framework 3.5. Everything works
perfectly in our development environment. However when we deploy using the
new web deployment project to our testing environment we recieve the
following error when browsing to the website "asp.net client side framework
failed to load".
We have also copied all the code across and receive the same error so it is
not a deployment issue it has something to do with the box. Are there any
special Security settings that we may have missed? The box still runs the 2.0
version of the site fine. We are using IIS6 and we have installed the 3.5
framework on this box.We are using IE7 .
Any suggestions would be appreciated
|
|
|
|
|
I have created all the pages with Master page.i want to clear each page controls using with javascript.how can i write a javascript to clear controls for each page.can anyone can send some code to me.each page clear button onClick Event i want to call this Javascript.
|
|
|
|
|
Ok I am creating an "Inventory" database with a web form where you can edit, delete, and add data. Everythign is working good but I am wondering hwo to do something.
I have these fields for example: Type, Brand, Model, Assigned_To, Serial, Tag_Number.
Now I've created three drop boxes and binded them to Assigned_To, Serial, and Tag_Number (each individually). One is to Assigned_To, one is to Serial, and another is to Tag_Number.
Now.. some people might have multiple products assigned to them.
Like for me example:
Laptop - Jacob Dixon
Blackberry - Jacob Dixon
Now in the drop box Jacob Dixon will appear twice since it binds all the fields from Assigned_To and my name is in there twice..
How would I stop that? I am binding it with visual web developer 2008. Also how can I make it where you cannot enter duplicate numbers in Serial, and Tag_Numbers? Like a message box will pop up and say: That Serial already exist in this database.. same for the Tag_Number
|
|
|
|
|
Can you make the data source for the drop down be a seperate SQL statement ? I thought you could bind the drop down to your list of names ( for example ), assuming your DB kept a list of names which was then indexed to in your main DB. If you have the same name over and over, you could do a select DISTINCT.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Awesome thats great.. It works perfect! How do I make fields in the database not be the same. Like Under the Tag_Number there cannot be duplicate tags.. if there is, someone messed up.. How do I assign that? Through my dataset? If so how do I make it where it won't throw an error if that does happen and instead erase it and show a message box saying there is already another tag number
|
|
|
|
|
When you enter a value, there's a callback, you can do validation there, if a client side validator won't do it
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
is it possible to display one(!!) UpdateProgress for every updatePanel on a page except specyfic one?!
i've got one that has a timer control on, and it causes UpdateProgress to show.
life is study!!!
|
|
|
|
|
I have controls on a page (a combobox with autopostback and a button).
When I click one, the page loads, then does the trigger.
ie. Change the combobox selection, the page just refreshes. The trigger updates variables then does nothing. The next time I change the selection, the changed variables are processed in the Load, but it's too late, AND my selection is different now, so those variables are not correct.
The button click causes Load, then the trigger, with the same back-assward behaviour.
I need the opposite to happen, since the trigger code affects what will be displayed in the Load.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
I Just noticed those controls are in Panels.
If I add a control outside a Panel (on the bare page), it triggers normally.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
What do you mean by 'trigger' ? All events happen after page load, any code that renders based on events should be in page prerender.
What's ass backwards is that an ASP.NET page by default has the load and not the prerender event.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks, I'll try that.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
Hi, I have a website build in ASP.Net 2.0. I also have a ftp site to test the website. I placed my files in a folder called test. My home page is therefore test/Forms/Home.aspx. I have been told that I require an index.htm file for the site so I added one with code to redirect to the home page. My web.config file is in the test folder and I have set <customErrors mode="Off"/>
The problem is that whenever I go to www.mysite.com/test I get this error
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I hope I have supplied enough background information. May someone please help me.
Thank you in advance
|
|
|
|
|
Dot Net rookie wrote: Hi, I have a website build in ASP.Net 2.0. I also have a ftp site to test the website.
I don't understand that, do you have link to a page the explains using a FTP site to test an ASP.NET application?
led mike
|
|
|
|
|
I would like to test my website on a ftp server. I get the runtime error I pasted above whenever I go the site. I have no idea how to fix it.
|
|
|
|
|
I want to catch 404 page not found errors in my C# ASP.net 2.0 website.
So I put...........
<customErrors mode="On" defaultRedirect="UnexpectedError.aspx">
<error statusCode="404" redirect="PageNotFound.aspx"/>
</customErrors>
in my web config file, great.
If I change the URL in the browser from www.mysite.homepage.aspx to www.mysite.omepage.aspx my pagenotfound page displays. whats the problem??
If i change it to www.mysite.homepage.spx I get a standard 404 error but no custom page, is this not a real 404?
Any clues??
Harvey
|
|
|
|
|
imnotso# wrote: <customerrors mode="On" defaultredirect="UnexpectedError.aspx">
<error statuscode="404" redirect="PageNotFound.aspx">
This is in the application web.config processed by ASP.NET. Hence 404s that can be trapped from within the application which are ASP.NET parseable files alone get through this filter. Everything else passes through the standard IIS 404 filter, which you may need to configure or have all requests routed through ASP.NET, which might increase the load on ASP.NET.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|