Linqdatasource onupdating event


19-Nov-2014 17:12

-- ============================================= -- Description: Just pass in 5 parameters, others are to be set by default values -- ============================================= ALTER PROCEDURE [dbo].[Register New Customer] @domain varchar(200), @password nvarchar(20), @first Name nvarchar(50), @last Name nvarchar(50), @email nvarchar(200) AS BEGIN SET NOCOUNT ON; IF (EXISTS(SELECT TOP 1 sid FROM Site WHERE [email protected])) RETURN 2; ELSE BEGIN INSERT INTO Site(domain, password, first Name, last Name, email) VALUES(@domain, @password, @first Name, @last Name, @email); RETURN 1; END END protected void btn Sign Up_Click(object sender, Event Args e) { using (Site Data Context dc = new Site Data Context()) { int return Value = dc.

Please log in now."; else if (return Value==2) lb Succeed. The domain name has already been registered."; else lb Succeed.

Anyway, I have a MSSQL database with asp membership info in it.

For various reasons (mainly to store profile info in clear columns instead of all in one) I'm using a custom profile provider so my profile information is spread across a few tables in my database.

NET Linq Data Source- asp: Linq Data Source เป็น Control ใน Visual Studio ที่ใช้สำหรับ Linq Data Source ซึ่งในตัวอย่างนี้จะเป็นการสร้าง LINQ To SQL (SQL Server) โดยใช้ Control ที่มีมาให้ของ Visual Studio LINQ คืออะไร ขออ้างอิงจากบทความของคุณ blur Eyes Framework : 2,3,4 Syntax เริ่มจากการคลิกขวาที่ Project เลือก Add New Item เลือก LINQ To SQL Classes เลือก Yes เพื่อวาง Code ไว้ที่ App_Code จะได้พื้นที่สำหรับการ Design Class Database ให้เลือก Server Explorer ของ SQL Server ลาก Table เข้ามาในส่วนของ Design Class พร้อมกับ Save ลาก Control ชื่อ Linq Data Source เข้ามาใน Web Form และคลกที่ Configure Data Source เลือก Class Data Context ที่ได้จากการสร้างข้างต้น เลือก Table ที่ต้องการ ทดสอบกับ Control ของ Grid View Partial Class _Default Inherits System. So now I have a gridview that uses a Linq Data Source that is connected to the aspnet_membership table.I have the normal aspnet_membership and aspnet_profle, but then I also have a tbl User Profile table, in which I store a bunch of user profile information like first name, phone number etc.The tbl User Profile also has a company ID in it, referring to a seperate table with a list of companies in it. I created a datamodel diagram that contains all the tables I'm using and it shows the keys linking up etc properly.

All of these are achieved just with a simple stored proc.

In addition, please notice the return Value from the stored proc gives me more a rich feedback.



TA TAE TAHOE TAI TAIYO TAO TAY TE TEA TEE TEO TEW THAI THAO THAU THAW THE THEA THEE THEO THEW THEY THI THIGH THO THOU THOUGH THUY THY TI TIA TIE TIEU TO TOA TOE TOO TOOHEY TOUHEY TOW TOWE TOWEY TOY TOYA TOYE TOYO TOYOO TROIS TSUDA TU TUE TUOHEY TUOHY TWO TY TYE TYO UDAY UDE UDO UDY UEDA UHDE USAID USED UTAH UTHE UTT UYEDA WAD WADA WADDIE WADDY WADE WAHID WAID WAIDE WAIST WAIT WAITE WAITT WASEDA WASTE WAT WATT WATTIE WAYSIDE WAYT WE'D WEAST WED WEDD WEDOWEE WEED WEEDY WEHDE WEIDE WEIGHED WEIGHT WEIGHTY WEIST WEITH WESAT WEST WET WHAT WHEAT WHEATIE WHET WHIT WHITE WHITEY WHITT WHITTY WHIZZED WHO'D WHY'D WHY'D WHYTE WIATT WIDE WIDOW WIED WIEST WIGHT WISED WISEST WIST WIT WITH WITHEE WITHEY WITT WITTE WITTY WOESTE WOOD WOODIE WOODY WOOED WOULD WOWED WUEST WUYDA WYATT WYDEN WYETH WYTHE YACHT YASUDA YEAST YEDDA YEHUDA YEHUDI YET YETT YETTA YOAST YOEST YOST YOTT YOU'D YOU'D YOUTH YUST ZADA ZADEH ZAID ZASADA ZAWADA ZAYED ZAZUETA ZED ZEDILLO ZEIT ZEST ZETA ZIAD ZITA ZITO ZIYAD ZODY ZOETE2 ' AASE AGNE AH AIGNER AINE A AN ANA ANAYA ANEW AN ANNA ANNE ANNIE ANNO ANNOY ANNY ANWAY ANY ANYHOW ANYWAY AO AOU AOUN ASAHA ASEA ASEAN ASIAI ASSASSI ASSIG ASWI AUE AUNE AUZENNE AWA AY AYO C1 CECI CESSNA CEZANNE CISNEY CISSNA CYA EASO EI EISE EISI EISO E ENA ENEA ENNEA ENNUI ENO EOCENE EO EON ESSE ESSO EUA EWA EWE GNAU GNAW GNU HAA HAE HAH HAHNE HAI HAINEY HA HAN HANA HANAWAY HANE HANEY HANI HAN HANNA HANNAH HANNAY HANNEY HANNI HANNIE HANNY HANO HANOI HANWA HANWAY HANY HASA HASSA HASSE HASSO HASTE HAUGH HAU HAUSE HAWAIIA HAW HAYE HAY HAYNE HAYNIE HAZA HAZE HEANEY HEENEY HEH HEI HEINE HEINEY HEINI HEINO HEINY HE HENAO HENEY HENIE HEN HENNA HENNE HENNEY HEO HESSO HEU HEUSE HEW HEWSO HEYE HEY HEYNE HIAASE HIGHOSI HINE HINEY HIN HINNY HINO HOEH HOEHNE HOE HOENE HOH HO HON HONE HONEA HONEY HON HOO HOSNI HOSSAI HOSSEI HOSSEINI HOWISO HOWSO HOYNE HUA HUGHE HUGHEN HUGHSON HUH HU HUN HUSAI HUSE HUSO HUSSAI HUSSEI HUSSEINI HUSSO HUYNH HWA HYENA HYSO HYU HYUN IAI IA IANNI IASO I IN IN.… continue reading »


Read more