Monday, February 28, 2011

Detailsview Dropdownlist c#

<asp:TemplateField SortExpression="City" HeaderText="City" >
<ItemTemplate>
   <asp:Label ID="City" runat="server" 
   Text='<%# bind("City")%>' />    
 </ItemTemplate>


         <EditItemTemplate>
            <asp:DropDownList DataTextField="City" DataValueField="City" ID="DropDownList2" Runat="server" SelectedValue='<%# Bind("City") %>' >
               <asp:ListItem>CA</asp:ListItem>
               <asp:ListItem>jhjhhj</asp:ListItem>
               <asp:ListItem>UT</asp:ListItem>
               <asp:ListItem>MD</asp:ListItem>
            </asp:DropDownList>
         </EditItemTemplate>
</asp:TemplateField>

ModalPopupExtender Control AJAX C#

http://www.codeproject.com/KB/ajax/ASPModalInAction.aspx

Thursday, February 24, 2011

JD Edwards E1 Upload address Book Using Z-file method

 
I did following steps to upload Data in Address Book File using Z-file Method
1. Load data in F0101z2 using following excel file. Must check address book next number pick max number from f0101 file.
 
SZEDUS
SZEDBT
SZEDTN
SZEDLN
SZEDCT
SZTYTN
SZEDFT
SZEDDT
SZDRIN
SZEDDL
SZEDSP
SZPNID
SZTNAC
SZAN8
SZALKY
SZTAX
SZALPH
SZDC
SZMCU
SZSIC
SZLNGP
SZAT1
SZCM
SZTAXC
SZAT2
SZAT3
SZAT4
SZATR
SZAT5
SZATP
SZATPR
SZAB3
SZATE
SZSBLI
SZEFTB
SZAN81
SZAN82
SZAN83
SZAN84
SZAN86
SZAN85
SZAC01
SZAC02
SZAC03
SZAC04
SZAC05
SZAC06
SZAC07
SZAC08
SZAC09
SZAC10
SZAC11
SZAC12
SZAC13
SZAC14
SZAC15
SZAC16
SZAC17
SZAC18
SZAC19
SZAC20
SZAC21
SZAC22
SZAC23
SZAC24
SZAC25
SZAC26
SZAC27
SZAC28
SZAC29
SZAC30
SZGLBA
SZPTI
SZPDI
SZMSGA
SZRMK
SZTXCT
SZTX2
SZALP1
SZURCD
SZURDT
SZURAT
SZURAB
SZURRF
SZMLNM
SZMLN1
SZADD1
SZADD2
SZADD3
SZADD4
SZADDZ
SZCTY1
SZCTR
SZADDS
SZCOUN
SZAR1
SZPH1
SZPHT1
SZAR2
SZPH2
SZPHT2
SZTORG
SZUSER
SZPID
SZJOBN
SZUPMJ
SZTDAY
SZUPMT
SZPRGF
SZSCCLTP
SZPA8
Rajeev
3111111
1
0
  
JDEAB   
          
0
 
0
Y
               
A 
1266226
4718
                    
abba
ajaj
zzzz
          
  
C
  
 
N
N
N
Y
N
Y
N
 
N
 
0
0
0
0
0
0
0
CU 
   
   
   
   
   
   
   
   
   
   
   
   
2
   
LA 
4
   
   
   
   
   
   
   
   
   
   
   
   
   
        
0
0
 
                              
                    
                    
                                        
  
0
0
0
55555
aaaa
                                        
aaaaa
                                        
                                        
                                        
9999
dds
US 
CA
                         
      
232323
    
      
                    
    
Rajeev
rajeev
EXCELDATA
PD810     
111055
0
120000
 
  
0
Rajeev
3111111
10
0
  
JDEAB   
          
0
 
0
Y
               
A 
1266235
4781
                    
aaaa
aaaa
zzzz
          
  
C
  
 
N
N
N
Y
N
Y
N
 
N
 
0
0
0
0
0
0
0
CU 
   
   
   
   
   
   
   
   
   
   
   
   
2
   
LA 
4
   
   
   
   
   
   
   
   
   
   
   
   
   
        
0
0
 
                              
                    
                    
                                        
  
0
0
0
55555
aaaa
                                        
aaaaa
                                        
                                        
                                        
9999
dfssds
US 
CA
                         
      
232323
    
      
                    
    
Rajeev
rajeev
EXCELDATA
PD810     
111055
0
120000
 
  
0

 

2. Run R01010Z file to load data.
3. Must change Next number for address no. go NN in fast path -> address book and pick your max number +1.
 
 

Monday, February 21, 2011

Android- Generating an EAN13 Barcode

The European Article Number, or EAN, is a standard European barcode which is designed to encode the identification of a product and its manufacturer and is a superset of the American standard, UPC. The format of the EAN13 barcode encodes a string of 12 characters followed by a 13th character which acts as the control number and is calculated through a formula based on the first 12 characters. 



http://www.codeproject.com/KB/android/androidean13gen.aspx

Wednesday, February 16, 2011

Obout grid sample


<%@ Page Language="C#" %>
<%@ Register TagPrefix="obout" Namespace="Obout.Grid" Assembly="obout_Grid_NET" %>
<%@ Register TagPrefix="obout" Namespace="Obout.Interface" Assembly="obout_Interface" %>
<%@ Register TagPrefix="obout" Namespace="Obout.SuperForm" Assembly="obout_SuperForm" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="C#" runat="server"> 
 void Page_load(object sender, EventArgs e)  
 { 
    }
    void CreateGrid()
    {
       
        SqlConnection myConnection = new SqlConnection("Data Source=devsrv;Initial Catalog=devdb;User ID=peoplesoft;Password=11111");
        string strSQL = "SELECT * FROM [patable_1]";
        SqlDataAdapter ad = new SqlDataAdapter(strSQL, myConnection);
        DataSet ds = new DataSet();
        ad.Fill(ds);
        grid1.DataSource = ds;
        grid1.DataBind();
       
    }
    void DeleteRecord(object sender, GridRecordEventArgs e)
    {
        SqlConnection myConnection = new SqlConnection("Data Source=devsrv;Initial Catalog=devdb;User ID=peoplesoft;Password=11111");
        string strSQL;
        strSQL = "delete from patable_1 "
        + " WHERE selectedCustomerTranId =" + e.Record["selectedCustomerTranId"];
        SqlCommand cmd = new SqlCommand(strSQL, myConnection);
        cmd.Parameters.AddWithValue("@CustName", e.Record["CustName"]);
        cmd.Parameters.AddWithValue("@meetinglocation", e.Record["meetinglocation"]);
        myConnection.Open();
        cmd.ExecuteNonQuery();
        myConnection.Close();
       
    }
    void UpdateRecord(object sender, GridRecordEventArgs e)
    {
       // Response.Redirect("saasas.aspx" + e.Record["selectedCustomerTranId"]);
       
        SqlConnection myConnection = new SqlConnection("Data Source=devsrv;Initial Catalog=devdb;User ID=peoplesoft;Password=11111");
        string strSQL;
        strSQL = "update patable_1 set CustName=@CustName,meetinglocation=@meetinglocation"
        + " WHERE selectedCustomerTranId =" + e.Record["selectedCustomerTranId"];
        SqlCommand cmd = new SqlCommand(strSQL, myConnection);
        cmd.Parameters.AddWithValue("@CustName", e.Record["CustName"]);
        cmd.Parameters.AddWithValue("@meetinglocation", e.Record["meetinglocation"]);
       
        myConnection.Open();
        cmd.ExecuteNonQuery();
        myConnection.Close();
       
       
    }
    void InsertRecord(object sender, GridRecordEventArgs e)
    {
   
    }
    void RebindGrid(object sender, EventArgs e)
    {
        CreateGrid();
    } 
   
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
  <obout:Grid id="grid1" runat="server" EnableRecordHover="True" AutoGenerateColumns="false"
    DataSourceID="SqlDataSource1"  OnEditCommand="UpdateRecord"
         OnRebind="RebindGrid" OnInsertCommand="InsertRecord" OnDeleteCommand="DeleteRecord" OnUpdateCommand="UpdateRecord"
             >
           <Columns>
                <obout:Column ID="Column1" DataField="selectedCustomerTranId"  HeaderText="ORDER ID" runat="server">
        <TemplateSettings RowEditTemplateControlId="txtselectedCustomerTranId" RowEditTemplateControlPropertyName="innerHTML"/>
    </obout:Column>
                <obout:Column ID="Column2" DataField="CustName"  HeaderText="CustName" runat="server">
        <TemplateSettings RowEditTemplateControlId="txtCustName" RowEditTemplateControlPropertyName="innerHTML"/>
    </obout:Column>
                <obout:Column ID="Column3" DataField="meetinglocation"  HeaderText="meeting Location" runat="server">
        <TemplateSettings RowEditTemplateControlId="txtmeetinglocation" RowEditTemplateControlPropertyName="innerHTML"/>
    </obout:Column>
                <obout:Column ID="Column4" HeaderText="EDIT" Width="200" AllowEdit="true" AllowDelete="true" runat="server" />
           </Columns>
         <TemplateSettings RowEditTemplateId="tplRowEdit" />
   <Templates>       
       <obout:GridTemplate runat="server" ID="tplRowEdit">
                    <Template>
                        <table class="rowEditTable">
                            <tr>
                                <td valign="top">
                                    <fieldset style="width: 275px; height: 175px;">
                                        <legend>Ship Information</legend>
                                        <table>                                                
                                            <tr>
                                                <td>Ship Name:</td>
                                                <td>
                                                    <obout:OboutTextBox runat="server" ID="txtselectedCustomerTranId" Width="150" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Ship Address:</td>
                                                <td>
                                                    <obout:OboutTextBox runat="server" ID="txtCustName" Width="150" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Ship City:</td>
                                                <td>
                                                    <obout:OboutTextBox runat="server" ID="txtmeetinglocation" Width="150" />
                                                </td>
                                            </tr>
                    
                    
                    </table>                             
                    </Template>
                </obout:GridTemplate>
   </Templates>
  
  </obout:Grid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
            SelectCommand="SELECT * FROM [patable_1]"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>

Tuesday, February 15, 2011

Format date in sqldatasource sql obout

select FORMAT(OrderDate, 'mm/dd/yyyy') AS OrderDateFormatted from yourtbl

Monday, February 14, 2011

Validating string with atleast 1 number and 1 letter c#

Regex re = new Regex(@"\d+");

Match m = re.Match(TextBox2.Text.Trim());

Regex relt = new Regex(@"^[a-zA-Z]+$");

Match n = re.Match(TextBox2.Text.Trim());

 

if (m.Success && n.Success)

{

//errcd = "Error";

// Label8.Text = string.Format("RegEx found " + m.Value + " at position " + m.Index.ToString());

//Response.Write("asssaas");

}

else

{

errcd =

"Error";

//Response.Write("22222");

//Label8.Text = "You didn't enter a string containing a number!";

}

Create Table Command

CREATE TABLE [dbo].[patable_1](
[selectedCustomerTranId] [varchar](1) NOT NULL,
[ScheduledId] [varchar](1) NOT NULL,
[SelectedCustomerId] [varchar](1) NOT NULL,
[CustName] [varchar](1) NOT NULL,
[meetinglocation] [varchar](1) NOT NULL,
[Begindate] [varchar](1) NOT NULL,
[description] [varchar](1) NOT NULL
) ON [PRIMARY]

Friday, February 11, 2011

String Date validation C# asp.net

using

System;

using

System.Collections.Generic;

using

System.Linq;

using

System.Web;

using

System.Web.UI;

using

System.Web.UI.WebControls;

public

partial class Default5 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

private bool ValidateDate(string date)

{

try

{

string[] dateParts = date.Split('/');

DateTime testDate = new

DateTime(Convert.ToInt32(dateParts[2]),

Convert.ToInt32(dateParts[0]),

Convert.ToInt32(dateParts[1]));

Response.Write(

"No error ");

return true;

}

catch

{

Response.Write(

"error");

return false;

}

}

protected void Button1_Click(object sender, EventArgs e)

{

ValidateDate(TextBox1.Text);

}

}