I have a table with 4 columns,
> First Column is auto-incremented numeric field,
>
> I want to get the value of that auto incremented field, when i insert a new
> record.
> because i need to send that number back to my funcation.
>
>
> Pls look at the function bellow.
>
>
>
> public bool AddHotelBookingInfo(Hashtable BookingInfo,ref string
> BookingConfrmNo)
> {
> ObjConn.OpenConnection ();
> try
> {
> string InsertQry="Insert into Tab_BookingDtls (H_Name,H_Id,Guest_FName)
> values";
> InsertQry += " '"+
> BookingInfo["h_Name"].ToString().Replace("'","''")+"','"+BookingInfo["h_Id"].ToString().Replace("'","''")+"','"+BookingInfo["g_FName"].ToString().Replace("'","''")+"'";
> SqlCommand objCmd=new SqlCommand(InsertQry,ObjConn.mysqlconn);
> objCmd.ExecuteNonQuery();
> BookingConfrmNo="100000"; //autoincremented value to be replaced with.
> ObjConn.CloseConnection();
> return true;
> }
> catch
> {
> BookingConfrmNo="0";
> ObjConn.CloseConnection();
> return false;
> }
> }
Thanks & Regards
Arindam
Web Designer & Developer
Yahoo! India Matrimony: Find your life partneronline.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/