Simple solution:
Select MAX(xxxID) From xxxTable
Tuesday, May 15, 2007
identity ID of the inserted row with TableAdapter.Insert()
SOAP Request XML with User Credentials
private string SAR(XmlDocument requestXML, string webServiceName)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(webServiceBasePath + webServiceName);
request.Headers.Add("SOAPAction", webServiceBasePath + webServiceName);
request.Credentials = new NetworkCredential(kulAdi, kulSif);
request.ContentType = "text/xml";
request.Method = "POST";
request.Accept = "text/xml";
Stream stm = request.GetRequestStream();
stm.Write(System.Text.Encoding.ASCII.GetBytes(requestXML.InnerXml.ToString()), 0, requestXML.InnerXml.ToString().Length);
stm.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader r = new StreamReader(response.GetResponseStream(), System.Text.Encoding.UTF8);
return r.ReadToEnd();
}
Monday, May 14, 2007
ie6 ie7 CSS min-height problem
Different Internet explorer versions interpret CSS differently. One of the common problem is to set a minimum height for a tag or div section. Just setting up min-height property will not be enough because of the fact that ie6 does not have a support. Below you will find very simple workaround for the problem.
Solution:
min-height:600px;
height: auto;
height: 600px;
Now it works for both browsers.
Remote MS SQL Server connection with SQL Server Management Studio
If you have your database in a remote server, probably you would like connect to it from your computer directly and edit your databases rather than explicitly connecting to your remote computer via remote desktop connection. The advantage of this approach is, it is far away faster and you don't need to install any unnecessary database tools to your remote server.
Here is the very helpful article how to achieve this;
http://www.aquesthosting.com/HowTo/Sql2005/connect.aspx
How to bring print dialog with Javascript
Simple Solution:
(a href="Javascript:self.print()")Print this page(/a)
Print this page
Invalid postback or callback argument problem
Solution:
Nothing to do with enableEventValidation. Just dont forget if (!IsPostBack) in the Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
}
Gridview, passing row index with CommandArgument
CommandArgument='%# DataBinder.Eval(Container, "RowIndex")%'
Note: Dont forget brackets.. Blog does nor allow to show them.
Gridview FindControl in Headerrow returns null problem
Sample solution:
(TextBox)this.GridView2.HeaderRow.FindControl(("TextboxID"));