TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sreenu kolusu
NA
38
181k
Submitting to a Database in InfoPath Forms Services?
Aug 9 2012 2:45 PM
public void CTRL5_5_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
SqlConnection con = new SqlConnection("Data Source=192.168.0.11;Initial Catalog=SampleDB;User ID=sa;Password=@System12");
XPathNavigator mypath = this.CreateNavigator();
string strname = mypath.SelectSingleNode("/my:myFields/my:txtname", NamespaceManager).Value;
string strloc = mypath.SelectSingleNode("/my:myFields/my:txtlocation", NamespaceManager).Value;
string strdept = mypath.SelectSingleNode("/my:myFields/my:txtdept", NamespaceManager).Value;
string strsql = "insert into employee values('"+strname+"','"+strloc+"','"+strdept+"')";
SqlCommand cmd = new SqlCommand(strsql, con);
try
{
con.Open();
cmd.ExecuteNonQuery();
MessageBox.Show("save successfully");
}
catch (SqlException ex)
{
MessageBox.Show("Not Saved" + ex.Message);
}
finally
{
con.Close();
}
}
Reply
Answers (
1
)
managed Client object model in sharepoint2010
Migrating Sharepoint 2007 Site To Sharepoint 2010