.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

select specific field from DB

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :ASP.Net
 

how to select  a specific field data from DB

using  HQL   ,  working with Nhibernate    with C#.net




View Complete Post


More Related Resource Links

select of X items in a single field

  
Hi! I've a select like this:select fieldA,fieldBfrom tablebut fieldB must be a list of items of another table:something like this:select fieldA, (select itemA from table2 where idref = table.id) AS fieldB from tableI need to show in fieldB a list of items (X records) returned from my second SELECT with a "-" for separate X fieldsI should show in fielB this:itemA - itemB - item C - item Dis it possible?Thanks

User Specific Values for a Drop Down "Choice" Field

  
I would like to create a drop down field which has some fields disabled or not visible based on the user logged in.  Is this possible?

How to return a specific field from the last record entered

  

I have two tables, Discrepancies and Actions that are linked by a field called JobNumber

What I need to do in a stored procedure is return a date field from the last record entered in the Actions table where the JobNumber is the same

The Actions tables primary key is an Identity field.

I'm trying to make a subquery but am stuck on the syntax.

Any help would be appreciated, this is just a bit beyond my skill set. Thanks.


Conditional insert: If select return rows, insert rows to table otherwise insert specific row indica

  
This is what I have

Insert into ReportDetail( Partcipantid, Reportid)  

select distinct ParticipantID , 9 from OpenCredit

      except select ParticipantID, 9 from StoreCredit where Closed = 0

 Issue is that when above select statement returns no row, it seems like no record is

Select statement with two group level to create addtional field.

  

Here is an example of my question

I have  a column called Department, a column called Employee Name and a column called EmployeeAbsent.

Obviously i can easily use a select satement to get each employee's absent status. However, I would like to generate an additional field called DepartmentAbsent to see if anyone in a particular depart is absent based on the EmployeeAbset field.

how should I write the query?


Datagrid: How to select a specific row by program?

  

How to select a specific row in the Datagrid (in WPF) programmatically? (like datagridview1.Rows(index).Selected = True in Windows form)?

I wants to select first row programmatically by defualt after it populating all the records. I treid DataGrid1.Selectedcell and all similar methods, but not able to get what I need. It looks that Data grid in WPF does not have anything related to Row while DataGrid is in Windows form have many things related to Row

 

Thanks


Dreaming a world without any war in anywhere

Nhibernate query ? specific field

  

how to pick a specific field (besides Primarykey field ) through HQL query ???


select particular field from xml file

  

Hi friends this is my xml file


<?xml version="1.0" encoding="utf-8" ?>
<Employees>
  <Employee>
    <Id>100</Id>
    <Name>arun</Name>
    <Dept>Electrical</Dept>
    <dtdate>12-05-2010 </dtdate>
  </Employee>
  <Employee>
  <Id>101</Id>
  <Name>Aji</Name>
  <Dept>Computer</Dept>
    <dtdate>13-05-2010 </dtdate>
  </Employee>
  <Employee>
  <Id>102</Id>
  <Name>Kiran</Name>
  <Dept>civil</Dept>
    <dtdate>14-05-2010 </dtdate>
  </Employee>

</Employees>


i want to display records of employee with id=100.


i tried this example

XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(Server.MapPath("Employee.xml"));
        DataSet ds = new DataSet();
        ds.ReadXml(xmlDoc.SelectNodes("//Employees//Employe

In Crystal Reports selection formulas/select expert with formula field and parameter field together

  

I have this report that does not yield the same output from my crystal reports to ssrs due to below selection formula.  Any help would be much appreciated.

Is there any workaround on this combined formula of parameter and formula field i.e {@HomeCo} in {?Company}

@HomeCo as being ...

if isnull({VP_TIMESHEET.LABLEVELNAME4})=true or {VP_TIMESHEETITMV42.LABLEVELNAME4} = "00000"
    or isnull({VP_TIMESHEET.LABLEVELNAME5})=true or {VP_TIMESHEETITMV42.LABLEVELNAME5} = "00000"
    then {view_EmpMaster_ca1.LABLEV4NM}
else {VP_TIMESHEET.LABLEVELNAME4}

and {?Company} as being ...

select distinct COMP_ID,COMP_DESC
from COST_ALLON.dbo.COMP where COMP_ID NOT IN ('0110', '0610')

Thanks,

Sweet_and_Sour


select record where field = variable?

  

Hi, I'm very new to SQL so please excuse how simple this problem is:

I've got a web page which contains a form, the form holds the following boxes:

  • Latitude
  • Longitude
  • Accuracy
  • Update
  • UserName

I have also got an access database , containing one table (Table1) which has the fields:

  • Latitude
  • Longitude
  • Accuracy
  • Update
  • UserName

The "UserName" field is the primary key (containing an email address)

What I want to do is select the record that has the same email address as entered into the form and update the rest of the fields with the data entered into the form.

The problem I'm having, as I see it, is that I can't seem to compare a string to a record UserName?

When I enter the email address manually it works and updates the record but it won't pull the email address from the variable string?

Here is my .asp code:

 

<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query for the database
Dim email 'Holds the current users email address

email = (Request.Form("UserName"))

Set dbConn = Server.CreateObject(

when I select to 'set field in current item', the only option available is name

  

Hi Clayton,

I have published my form and promoted the fields and ticked the appropriate box when publishing, but when I select to 'set field in current item', the only option available is name (For Use In Forms). I would like to be able to set the value of an infopath field from within the SPD workflow workflow. So for instance, when the form is approved, a field is set to approved on the form and a button becomes available.

 

Thanks in advance


how to create an specific column and use it in many lists like "Title" field

  
In my sharepoint site I have lists that some fields are repeating in two list or more,to prevent of repeating I want to define one column or field and use it in any lists that I want, so I defined a column as an empty element and add it into my project,and in schema.xml file of my list .I add the

<FieldRef ID

how to create an specific column and use it in many lists like "Title" field

  
In my sharepoint2010 site I have lists that some fields are repeating in two list or more,to prevent of repeating I want to define one column or field and use it in any lists that I want, so I defined a column as an empty element and add it into my project,and in schema.xml file of my list .I add the

<FieldRef ID

AJAX GridView Checkbox Select All in ASP.Net

  
In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

calculation, field and map traverse adjustment, and coordinate transformation

  
Free Pocket PC land surveying software -- COGO calculation, field and map traverse adjustment, and coordinate transformation -- for students and professionals.

Dropdown Event (Template Field)

  

Hi,

I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?


How to take value of bound field of grid in a variable or in a textbox.

  

How to take value of bound field of grid in a variable or in a textbox.

 I m using this code in .aspx page for grid.

<asp:GridView ID="Grd_Mprocess" runat="server" AutoGenerateColumns="False"

                      Width="100%" AllowPaging="True"

                      onpageindexchanging="Grd_Mprocess_PageIndexChanging"

                      AllowSorting="True" PageSize="5"  >

                 <RowStyle CssClass="odd" />

                    <Columns> 

<asp:BoundField HeaderText="DOC_TYPE_PK" DataField="DOC_TYPE_PK"  Visible="true" >

</asp:BoundField>

  <asp:TemplateField HeaderText="DOC TYPE ID" Visible="true">  &nbs

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend