backgroundColor="#FFFFFF"
initialize="initApp()">
import RemoteTest.Title;
title=new Title();
}
title.au_id=au_id.text;
title.title_id=title_id.text;
title.au_ord=Number(au_ord.text);
title.royaltyper=Number(royaltyper.text);
srv.addEmployee(title);
}
srv.getEmployee(au_id.text);
}
function onGetData(event:Object):Void {
title = event.result;
<mx:method name="addEmployee"/>
</mx:RemoteObject>
<mx:TextInput id="au_id"/>
</mx:FormItem>
<mx:FormItem label="title_id">
<mx:TextInput id="title_id"/>
</mx:FormItem>
<mx:FormItem label="au_ord">
<mx:TextInput id="au_ord"/>
</mx:FormItem>
<mx:FormItem label="royaltyper">
<mx:TextInput id="royaltyper"/>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Add Employee" click="addTitle()"/>
</mx:FormItem>
<mx:Button label="Get Employee" click="getTitle()"/>
</mx:FormItem>
</mx:Form>
class RemoteTest.Title {
public var title_id : String;
public var au_ord : Number;
public var royaltyper : Number;
Object.registerClass("RemoteTest.Title", RemoteTest.Title);
using
System;using
FlashGateway.IO;using
System.Xml;using
System.Data;using
System.Data.SqlClient;using
System.IO;using
System.Text;using
System.Collections;
namespace
RemoteTest{
public class Sample{
private SqlConnection conn;public void addEmployee(Title employee)
{
conn =new SqlConnection("data source=dt1305-priyanka\\netsdk; database=pubs;uid=sa;pwd=welcome;");
conn.Open();
SqlCommand sqlcomm = new SqlCommand();
sqlcomm.Connection=conn;
sqlcomm.CommandType = CommandType.Text;
sqlcomm.CommandText = "INSERT INTO titleauthor (au_id,title_id,au_ord,royaltyper) VALUES('"+employee.au_id + "','" +employee.title_id +"',"+employee.au_ord +","+employee.royaltyper +")";
sqlcomm.ExecuteNonQuery();
}
public
Title getEmployee(string au_id){
conn =
new SqlConnection("data source=dt1305-priyanka\\netsdk; database=pubs;uid=sa;pwd=welcome;");conn.Open();
SqlCommand sqlcomm =
new SqlCommand();sqlcomm.Connection=conn;
sqlcomm.CommandType = CommandType.Text;
sqlcomm.CommandText = "SELECT * FROM titleauthor WHERE au_id ='" + au_id + "'";
SqlDataReader readerObj = sqlcomm.ExecuteReader();
Title title =
new Title(); while (readerObj.Read()){
title.au_id = au_id;
title.title_id = readerObj.GetString(1);
title.au_ord = (System.Byte)readerObj.GetValue(2);
title.royaltyper = (Int32)readerObj.GetValue(3);
}
return title;}
}
}
using
System;namespace
RemoteTest{
[Serializable]
public class Title{
public string au_id; public string title_id; public int au_ord; public int royaltyper;}
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Computer software testing | Macromedia flex | Development |
Software developer |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.