我正在使用 Dotnetnuke 7 的 Module Creator 模板,试图让我们的员工登录模块功能。我正在使用几年前来自法国的一名志愿实习生为 DNN 5 Beta 开发的代码。(有些拼写是法语)我自己不是编码员,所以我在努力使代码在 DNN 7 中工作。通过阅读这个网站,我设法找出了很多编译错误。谢谢你。这个让我非常困惑:
Error: France is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException:
d:\HostingSpaces\tgpintra\tgpintranet.org\wwwroot\DesktopModules\TGP\France\View.ascx.cs(176): error CS1010: Newline in constant --->
从第 175 行开始的源代码如下:
//Set the parameters for updating user's information
SqlUpdate.UpdateCommand = "UPDATE Scotland SET
statut=@statut, timereturn=@timereturn, date=@date, comment=@comment
WHERE name='" +
DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().Username +
"'";
SqlUpdate.UpdateParameters.Add("statut",
DropDownList2.SelectedValue);
SqlUpdate.UpdateParameters.Add("timereturn",
timereturn.Text);
SqlUpdate.UpdateParameters.Add("date", DateTime.Now.AddHours
(-2).ToString());
SqlUpdate.UpdateParameters.Add("comment", comment.Text);
SqlUpdate.Update();
//Insert a log for the user and his/her new status
SqlConnection MaSqlCnx = new SqlConnection();
MaSqlCnx.ConnectionString = "Server=someserver.
net;Initial Catalog=tgpintra_db;User
Id=theusername;Password=thepassword;";
MaSqlCnx.Open();
SqlCommand MaSqlCmd = new SqlCommand();
MaSqlCmd.Connection = MaSqlCnx;
MaSqlCmd.CommandText = "Insert into ScotlandSchedule(name,
status, time) Values('" +
DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().FullName +
"', '" + DropDownList2.SelectedValue + "', '" + DateTime.Now.AddHours(-
2).ToString() + "');";
MaSqlCmd.ExecuteNonQuery();
MaSqlCnx.Close();
//Reload the page to update data
Response.AppendHeader("Refresh", "1");
}